55 - " master"
66 tags :
77 - " *"
8- pull_request_target :
8+ pull_request :
99 branches :
1010 - " master"
1111 workflow_dispatch :
2525 - uses : actions/checkout@v4
2626 - name : Set version
2727 id : set-version
28- run : echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
28+ run :
29+ - echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
30+ - name : Upload VERSION Artifact
31+ uses : actions/upload-artifact@v4.1.0
32+ with :
33+ path : VERSION
34+ name : VERSION
2935 lint :
3036 name : Run linters
3137 permissions :
@@ -80,11 +86,11 @@ jobs:
8086 triplet : x64-linux-ci
8187 host_triplet : x64-linux-ci
8288 - os : macos-15
83- os_name : macos-arm64
89+ os_name : macos_arm64
8490 triplet : arm64-osx-ci
8591 host_triplet : arm64-osx-ci
8692 - os : macos-15-intel
87- os_name : macos-x64
93+ os_name : macos_x64
8894 triplet : x64-osx-ci
8995 host_triplet : x64-osx-ci
9096 - os : ubuntu-24.04
@@ -186,7 +192,7 @@ jobs:
186192 cp THIRDPARTY.md README.md LICENSE "${{ github.workspace }}/release/${{ env.PresetName }}"
187193 shell : bash
188194 - name : Decode signing/prod.properties file
189- if : matrix.os_name == 'android' && (github.event_name != 'pull_request_target ' || github.event.pull_request.head.repo.full_name == github.repository)
195+ if : matrix.os_name == 'android' && (github.event_name != 'pull_request ' || github.event.pull_request.head.repo.full_name == github.repository)
190196 env :
191197 PROD_PROPERTIES : ${{ secrets.ANDROID_PROD_PROPERTIES }}
192198 PROD_JKS : ${{ secrets.ANDROID_PROD_JKS }}
@@ -250,110 +256,4 @@ jobs:
250256 uses : actions/upload-artifact@v4.1.0
251257 with :
252258 path : impacto-switch-${{ env.VERSION }}${{ github.run_number }}-${{ github.sha }}.zip
253- name : release-switch
254-
255- publish_artifacts :
256- name : Publish Artifacts
257- runs-on : ubuntu-22.04
258- permissions :
259- contents : write
260- needs :
261- - job-matrix
262- - switch
263- - get-version
264- env :
265- VERSION : ${{ needs.get-version.outputs.VERSION }}
266- if : needs.job-matrix.result == 'success' && needs.switch.result == 'success' && github.event_name != 'pull_request_target' && ((startsWith(github.ref, 'refs/tags') || github.ref_name == 'master'))
267- steps :
268- - uses : actions/download-artifact@v4
269- with :
270- pattern : release-*
271- path : " ${{ github.workspace }}/release"
272- merge-multiple : true
273- - name : Upload Release
274- uses : softprops/action-gh-release@v2
275- if : startsWith(github.ref, 'refs/tags') || (github.ref_name == 'master')
276- with :
277- Name : Latest ${{ env.BRANCH_NAME }} build
278- tag_name : ${{ env.VERSION }}${{ github.run_number }}
279- files :
280- ${{ github.workspace }}/release/*.zip
281- prerelease : true
282- fail_on_unmatched_files : true
283- target_commitish : ${{ github.sha }}
284- - name : Get current date
285- id : date
286- run : echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
287-
288- - uses : tsickert/discord-webhook@v5.3.0
289- with :
290- webhook-url : ${{ secrets.DISCORD_WEBHOOK_URL }}
291- username : IMPACTO
292- avatar-url : https://cdn.discordapp.com/emojis/766988033127481344.png
293- embed-title : " ${{ github.event.commits[0].author.name }}"
294- embed-color : 3659647
295- embed-timestamp : ${{ env.NOW }}
296- embed-description : |
297- Commit
298- `${{ github.event.head_commit.message }} (${{ github.sha }})`
299- from branch `${{ env.BRANCH_NAME }}` has been successfully built.
300-
301- Release URL:
302- https://github.com/CommitteeOfZero/impacto/releases/tag/${{ env.VERSION }}${{ github.run_number }}
303-
304- Details:
305- ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
306- notify_fail :
307- name : Notify failure
308- runs-on : ubuntu-22.04
309- needs :
310- - job-matrix
311- - switch
312- if : always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
313- steps :
314- - uses : actions/checkout@v2
315- - name : ' Get Jobs Status'
316- id : get_jobs_status
317- run : |
318- echo "Fetch workflow run jobs"
319- json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \
320- "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs")
321-
322-
323- name_conclusion_array=($(echo "$json_data" | jq -r '
324- .jobs[] |
325- select(.name | IN("macos-arm64", "linux", "windows", "switch", "macos-x64", "android")) |
326- "\(.name).\(.conclusion)"'))
327-
328- for item in "${name_conclusion_array[@]}"; do
329- IFS='.' read -r name conclusion <<< "$item"
330- echo "$name=$conclusion" >> $GITHUB_OUTPUT
331- done
332-
333- - name : Get current date
334- id : date
335- run : echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
336-
337- - uses : tsickert/discord-webhook@v5.3.0
338- with :
339- webhook-url : ${{ secrets.DISCORD_WEBHOOK_URL }}
340- username : IMPACTO
341- avatar-url : https://cdn.discordapp.com/emojis/766988033127481344.png
342- embed-title : " ${{ github.event.commits[0].author.name }}"
343- embed-color : 16711680
344- embed-timestamp : ${{ steps.date.outputs.NOW }}
345- embed-description : |
346- Commit
347- `${{ github.event.head_commit.message }} (${{ github.sha }})`
348- from branch `${{ env.BRANCH_NAME }}` has failed build.
349-
350- Job status:
351- windows: ${{steps.get_jobs_status.outputs.windows}}
352- linux: ${{steps.get_jobs_status.outputs.linux}}
353- macos-arm64: ${{steps.get_jobs_status.outputs.macos-arm64}}
354- macos-x64: ${{steps.get_jobs_status.outputs.macos-x64}}
355- switch: ${{steps.get_jobs_status.outputs.switch}}
356- android: ${{steps.get_jobs_status.outputs.android}}
357-
358- Details:
359- ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
259+ name : release-switch
0 commit comments