Trigger amap from another repo (#2171)
* Add s3 upload, repository dispatch * Add trigger * Fix map file upload * Debug * Add event file upload to s3 * fix triggering * Fix upload process * fix build.yml Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
39
.github/workflows/build.yml
vendored
39
.github/workflows/build.yml
vendored
@@ -30,11 +30,6 @@ jobs:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: 'Make artifacts directory'
|
||||
run: |
|
||||
rm -rf artifacts
|
||||
mkdir artifacts
|
||||
|
||||
- name: 'Get commit details'
|
||||
id: names
|
||||
run: |
|
||||
@@ -46,6 +41,15 @@ jobs:
|
||||
TYPE="other"
|
||||
fi
|
||||
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
|
||||
echo random_hash=$(openssl rand -base64 40 | shasum -a 256 | awk '{print $1}') >> $GITHUB_OUTPUT
|
||||
echo "event_type=$TYPE" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 'Make artifacts directory'
|
||||
run: |
|
||||
rm -rf artifacts
|
||||
rm -rf map_analyser_files
|
||||
mkdir artifacts
|
||||
mkdir map_analyser_files
|
||||
|
||||
- name: 'Bundle scripts'
|
||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||
@@ -82,9 +86,30 @@ jobs:
|
||||
run: |
|
||||
cp build/core2_firmware.tgz "artifacts/flipper-z-any-core2_firmware-${SUFFIX}.tgz"
|
||||
|
||||
- name: 'Copy .map file'
|
||||
- name: 'Copy map analyser files'
|
||||
run: |
|
||||
cp build/f7-firmware-*/firmware.elf.map "artifacts/flipper-z-f7-firmware-${SUFFIX}.elf.map"
|
||||
cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
|
||||
cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf
|
||||
cp ${{ github.event_path }} map_analyser_files/event.json
|
||||
|
||||
- name: 'Upload map analyser files to storage'
|
||||
uses: keithweaver/aws-s3-github-action@v1.0.0
|
||||
with:
|
||||
source: map_analyser_files/
|
||||
destination: "s3://${{ secrets.MAP_REPORT_AWS_BUCKET }}/${{steps.names.outputs.random_hash}}"
|
||||
aws_access_key_id: "${{ secrets.MAP_REPORT_AWS_ACCESS_KEY }}"
|
||||
aws_secret_access_key: "${{ secrets.MAP_REPORT_AWS_SECRET_KEY }}"
|
||||
aws_region: "${{ secrets.MAP_REPORT_AWS_REGION }}"
|
||||
flags: --recursive
|
||||
|
||||
- name: 'Trigger map file reporter'
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
repository: flipperdevices/flipper-map-reporter
|
||||
token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
|
||||
event-type: map-file-analyse
|
||||
client-payload: '{"random_hash": "${{steps.names.outputs.random_hash}}", "event_type": "${{steps.names.outputs.event_type}}"}'
|
||||
|
||||
|
||||
- name: 'Upload artifacts to update server'
|
||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||
|
||||
Reference in New Issue
Block a user