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 :
4046 uses : actions/checkout@v4
4147 - name : Update clang-format
4248 run : |
43- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
44- sudo apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-19 main"
4549 sudo apt update
46- sudo apt install -y clang-format-19
47- sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 1000
48- sudo update-alternatives --set clang-format /usr/bin/clang-format-19
49- sudo update-alternatives --display clang-format
50+ sudo pipx install clang-format
51+ which clang-format
5052 clang-format --version
5153
5254 - name : Run linters
@@ -84,11 +86,11 @@ jobs:
8486 triplet : x64-linux-ci
8587 host_triplet : x64-linux-ci
8688 - os : macos-15
87- os_name : macos-arm64
89+ os_name : macos_arm64
8890 triplet : arm64-osx-ci
8991 host_triplet : arm64-osx-ci
9092 - os : macos-15-intel
91- os_name : macos-x64
93+ os_name : macos_x64
9294 triplet : x64-osx-ci
9395 host_triplet : x64-osx-ci
9496 - os : ubuntu-24.04
@@ -190,7 +192,7 @@ jobs:
190192 cp THIRDPARTY.md README.md LICENSE "${{ github.workspace }}/release/${{ env.PresetName }}"
191193 shell : bash
192194 - name : Decode signing/prod.properties file
193- 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)
194196 env :
195197 PROD_PROPERTIES : ${{ secrets.ANDROID_PROD_PROPERTIES }}
196198 PROD_JKS : ${{ secrets.ANDROID_PROD_JKS }}
@@ -254,110 +256,4 @@ jobs:
254256 uses : actions/upload-artifact@v4.1.0
255257 with :
256258 path : impacto-switch-${{ env.VERSION }}${{ github.run_number }}-${{ github.sha }}.zip
257- name : release-switch
258-
259- publish_artifacts :
260- name : Publish Artifacts
261- runs-on : ubuntu-22.04
262- permissions :
263- contents : write
264- needs :
265- - job-matrix
266- - switch
267- - get-version
268- env :
269- VERSION : ${{ needs.get-version.outputs.VERSION }}
270- 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'))
271- steps :
272- - uses : actions/download-artifact@v4
273- with :
274- pattern : release-*
275- path : " ${{ github.workspace }}/release"
276- merge-multiple : true
277- - name : Upload Release
278- uses : softprops/action-gh-release@v2
279- if : startsWith(github.ref, 'refs/tags') || (github.ref_name == 'master')
280- with :
281- Name : Latest ${{ env.BRANCH_NAME }} build
282- tag_name : ${{ env.VERSION }}${{ github.run_number }}
283- files :
284- ${{ github.workspace }}/release/*.zip
285- prerelease : true
286- fail_on_unmatched_files : true
287- target_commitish : ${{ github.sha }}
288- - name : Get current date
289- id : date
290- run : echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
291-
292- - uses : tsickert/discord-webhook@v5.3.0
293- with :
294- webhook-url : ${{ secrets.DISCORD_WEBHOOK_URL }}
295- username : IMPACTO
296- avatar-url : https://cdn.discordapp.com/emojis/766988033127481344.png
297- embed-title : " ${{ github.event.commits[0].author.name }}"
298- embed-color : 3659647
299- embed-timestamp : ${{ env.NOW }}
300- embed-description : |
301- Commit
302- `${{ github.event.head_commit.message }} (${{ github.sha }})`
303- from branch `${{ env.BRANCH_NAME }}` has been successfully built.
304-
305- Release URL:
306- https://github.com/CommitteeOfZero/impacto/releases/tag/${{ env.VERSION }}${{ github.run_number }}
307-
308- Details:
309- ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
310- notify_fail :
311- name : Notify failure
312- runs-on : ubuntu-22.04
313- needs :
314- - job-matrix
315- - switch
316- if : always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
317- steps :
318- - uses : actions/checkout@v2
319- - name : ' Get Jobs Status'
320- id : get_jobs_status
321- run : |
322- echo "Fetch workflow run jobs"
323- json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \
324- "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs")
325-
326-
327- name_conclusion_array=($(echo "$json_data" | jq -r '
328- .jobs[] |
329- select(.name | IN("macos-arm64", "linux", "windows", "switch", "macos-x64", "android")) |
330- "\(.name).\(.conclusion)"'))
331-
332- for item in "${name_conclusion_array[@]}"; do
333- IFS='.' read -r name conclusion <<< "$item"
334- echo "$name=$conclusion" >> $GITHUB_OUTPUT
335- done
336-
337- - name : Get current date
338- id : date
339- run : echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
340-
341- - uses : tsickert/discord-webhook@v5.3.0
342- with :
343- webhook-url : ${{ secrets.DISCORD_WEBHOOK_URL }}
344- username : IMPACTO
345- avatar-url : https://cdn.discordapp.com/emojis/766988033127481344.png
346- embed-title : " ${{ github.event.commits[0].author.name }}"
347- embed-color : 16711680
348- embed-timestamp : ${{ steps.date.outputs.NOW }}
349- embed-description : |
350- Commit
351- `${{ github.event.head_commit.message }} (${{ github.sha }})`
352- from branch `${{ env.BRANCH_NAME }}` has failed build.
353-
354- Job status:
355- windows: ${{steps.get_jobs_status.outputs.windows}}
356- linux: ${{steps.get_jobs_status.outputs.linux}}
357- macos-arm64: ${{steps.get_jobs_status.outputs.macos-arm64}}
358- macos-x64: ${{steps.get_jobs_status.outputs.macos-x64}}
359- switch: ${{steps.get_jobs_status.outputs.switch}}
360- android: ${{steps.get_jobs_status.outputs.android}}
361-
362- Details:
363- ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
259+ name : release-switch
0 commit comments