1
+ name : ❯ Linux build 🐧 (aarch64-unknown-linux-gnu)
2
+ # On push to the main branch, build the project on Linux ARM64 Linux (kernel 4.1, glibc 2.17+) with GNU
3
+ on :
4
+ push :
5
+ branches : ["**"]
6
+ jobs :
7
+ # This job builds the project on Linux ARM64 Linux (kernel 4.1, glibc 2.17+) with GNU
8
+ build :
9
+ name : ❯ build
10
+ if : github.ref == 'refs/heads/main' && github.event_name == 'push'
11
+ strategy :
12
+ fail-fast : false
13
+ matrix :
14
+ rust-toolchain :
15
+ - stable
16
+ target :
17
+ # ARM64 Linux (kernel 4.1, glibc 2.17+) ✅ Tested
18
+ - aarch64-unknown-linux-gnu
19
+
20
+ include :
21
+ # Linux targets 🐧
22
+ - target : aarch64-unknown-linux-gnu
23
+ os : ubuntu-latest
24
+ cross : true
25
+ runs-on : ${{ matrix.os }}
26
+
27
+ steps :
28
+ # Check out the repository code
29
+ - name : Checkout sources
30
+ id : checkout
31
+ uses : actions/checkout@v3
32
+ with :
33
+ fetch-depth : 2
34
+
35
+ # Install the stable Rust toolchain
36
+ - name : Setup Rust
37
+ id : setup-rust
38
+ run : |
39
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
40
+ rustup default ${{ matrix.rust-toolchain }}
41
+
42
+ # Update the version number based on the Cargo.toml file
43
+ - name : Update version number
44
+ id : update-version
45
+ run : |
46
+ NEW_VERSION=$(grep version Cargo.toml | sed -n 2p | cut -d '"' -f 2)
47
+ echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
48
+ shell : /bin/bash -e {0}
49
+
50
+ # Build the target
51
+ - name : Build
52
+ run : cargo build --release
53
+
54
+ # Upload the binary for the target
55
+ - name : Upload binary to GitHub Packages
56
+ uses : actions/upload-artifact@v3
57
+ with :
58
+ name : hsh-${{ matrix.target }}-v${{ env.VERSION }}
59
+ path : target/release/hsh
60
+
61
+ # Tar the binary for the target
62
+ - name : Tar files
63
+ run : tar -czvf hsh-${{ matrix.target }}-v${{ env.VERSION }}.tar.gz target/release/hsh
64
+
65
+ # Upload the tarball for the target
66
+ - name : Upload Artifact
67
+ uses : actions/upload-artifact@v3
68
+ with :
69
+ name : hsh-${{ matrix.target }}-v${{ env.VERSION }}
70
+ path : hsh-${{ matrix.target }}-v${{ env.VERSION }}.tar.gz
71
+ run : |
72
+ echo "Binary uploaded successfully for ${{ matrix.target }}. URL: ${{ steps.upload-artifact.outputs.artifact_url }}"
73
+ shell : /bin/bash -e {0}
0 commit comments