Skip to content

Commit 0478de1

Browse files
feat(hsh): added ci jobs and various tweaks
1 parent 4d93277 commit 0478de1

37 files changed

+2967
-582
lines changed
+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: ❯ macOS build 🍎 (aarch64-apple-darwin)
2+
# On push to the main branch, build the project on 64-bit macOS on Apple Silicon
3+
on:
4+
push:
5+
branches: ["**"]
6+
jobs:
7+
# This job builds the project on 64-bit macOS on Apple Silicon
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+
# 64-bit macOS on Apple Silicon ✅ Tested
18+
- aarch64-apple-darwin
19+
20+
include:
21+
# Linux targets 🐧
22+
- target: aarch64-apple-darwin
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}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: ❯ Windows build 🪟 (aarch64-pc-windows-msvc)
2+
# On push to the main branch, build the project on ARM64 Windows MSVC
3+
on:
4+
push:
5+
branches: ["**"]
6+
jobs:
7+
# This job builds the project on ARM64 Windows MSVC
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 Windows MSVC ✅ Tested
18+
- aarch64-pc-windows-msvc
19+
20+
include:
21+
# Windows target 🪟
22+
- target: aarch64-pc-windows-msvc
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}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: ❯ Linux build 🐧 (aarch64-unknown-linux-musl)
2+
# On push to the main branch, build the project on Linux with MUSL (kernel 4.1, glibc 2.17+)
3+
on:
4+
push:
5+
branches: ["**"]
6+
jobs:
7+
# This job builds the project on Linux with MUSL (kernel 4.1, glibc 2.17+)
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 with MUSL (kernel 4.1, glibc 2.17+) ✅ Tested
18+
- aarch64-unknown-linux-musl
19+
20+
include:
21+
# Linux targets 🐧
22+
- target: aarch64-unknown-linux-musl
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}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# On push to the main branch, build the project on Linux ARMv6 Linux (kernel 3.2, glibc 2.17)
2+
name: ❯ Linux build 🐧 (arm-unknown-linux-gnueabi)
3+
on:
4+
push:
5+
branches: ["**"]
6+
jobs:
7+
# This job builds the project on Linux ARMv6 Linux (kernel 3.2, glibc 2.17)
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+
# ARMv6 Linux (kernel 3.2, glibc 2.17) ✅ Tested
18+
- arm-unknown-linux-gnueabi
19+
20+
include:
21+
# Linux targets 🐧
22+
- target: arm-unknown-linux-gnueabi
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

Comments
 (0)