Repository navigation
62 lines (52 loc) · 2.01 KB
/
Copy pathbinary.yml
File metadata and controls
62 lines (52 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Binary
on:
workflow_run:
workflows: [ Deploy ]
types: [ completed ]
release:
types: [ created ]
workflow_dispatch:
jobs:
get_last_release:
runs-on: ubuntu-latest
outputs:
latest_release_tag: ${{ steps.latest-release.outputs.LATEST_RELEASE_TAG }}
steps:
- uses: actions/checkout@v4
- name: Extract the latest release
id: latest-release
run: echo "LATEST_RELEASE_TAG=$(gh release ls --json isLatest,tagName -q '.[] | select(.isLatest == true) | .tagName')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
name: Build
runs-on: ${{matrix.platform.image}}
container: ghcr.io/jakestanger/ironbar-build:master
needs: get_last_release
strategy:
fail-fast: false
matrix:
platform:
- { image: ubuntu-latest, name: x86_64 }
- { image: ubuntu-24.04-arm, name: arm64 }
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.get_last_release.outputs.latest_release_tag }}
- name: Build Release
run: cargo build --locked --profile tagged-release
- name: Compress the built binary
run: tar -zcvf ironbar-${{needs.get_last_release.outputs.latest_release_tag}}-${{matrix.platform.name}}.tar.gz -C target/tagged-release ironbar
- name: Take ownership of repo
run: git config --global --add safe.directory .
- name: Upload to release
run: gh release upload ${{needs.get_last_release.outputs.latest_release_tag}} ironbar-${{needs.get_last_release.outputs.latest_release_tag}}-${{matrix.platform.name}}.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow Deploy failed'
- run: exit 1