-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (76 loc) · 2.46 KB
/
manual.yml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Manual Build
on:
workflow_dispatch:
inputs:
password:
required: true
architecture:
required: true
description: 'The architecture to build for'
type: choice
options:
- all
- aarch64
- x86-64
- static-aarch64
- static-x86-64
debug:
required: false
description: 'Enable debug mode'
type: boolean
default: false
# Don't allow multiple of the same job to run
concurrency:
group: "manual_build"
cancel-in-progress: false
jobs:
check_pass:
name: Check password
runs-on: ubuntu-latest
outputs:
is_allowed: ${{ steps.check.outputs.is_allowed }}
steps:
- id: check
run: |
password=${{ secrets.CI_PASSWORD }}
if [[ "${{ github.event.inputs.password }}" == "${password}" ]]; then
echo "is_allowed=true" >> $GITHUB_OUTPUT
else
echo "is_allowed=false" >> $GITHUB_OUTPUT
fi
build:
needs: check_pass
if: ${{ needs.check_pass.outputs.is_allowed == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🫙 Cache
uses: Swatinem/rust-cache@v2
with:
key: cache-v1
cache-on-failure: true
- name: 🛠️ Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: 📥 Install Dependencies
run: |
cargo xtask apt-install ${{ github.event.inputs.architecture }}
- name: 🔨 Build Debug Library For ${{ github.event.inputs.architecture }}
if: ${{ github.event.inputs.debug == 'true' }}
run: |
cargo xtask compile ${{ github.event.inputs.architecture }} --debug
- name: 🔨 Build Library For ${{ github.event.inputs.architecture }}
if: ${{ github.event.inputs.debug == 'false' }}
run: |
cargo xtask compile ${{ github.event.inputs.architecture }}
- name: 📝 Set Branch Name
id: set_branch
run: echo "FORMATTED_REF=${{ github.ref }}" | sed 's/\//-/g' >> $GITHUB_OUTPUT
- name: 📤 Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: branch-${{ steps.set_branch.outputs.FORMATTED_REF }}-arch-${{ github.event.inputs.architecture }}-debug-${{ github.event.inputs.debug }}
path: target/libseda_tally_vm*.*
overwrite: true