Skip to content

Commit 1a138f7

Browse files
committed
ci: add nightly workflow
1 parent b0a5edf commit 1a138f7

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

.github/workflows/nightly.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: aeris nightly
2+
concurrency:
3+
group: "${{ github.workflow }}-${{ github.ref }}"
4+
cancel-in-progress: true
5+
6+
on:
7+
push:
8+
tags:
9+
- nightly
10+
workflow_dispatch:
11+
schedule:
12+
- cron: '0 0 * * *'
13+
14+
permissions:
15+
attestations: write
16+
contents: write
17+
id-token: write
18+
19+
jobs:
20+
remove-nightly-tag:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v5
25+
26+
- name: Remove existing nightly tag
27+
run: |
28+
gh release delete nightly --cleanup-tag || true
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
publish-nightly:
32+
name: Publish nightly binaries
33+
runs-on: ${{ matrix.build.RUNNER }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
build:
38+
- {
39+
NAME: aarch64-linux,
40+
TARGET: aarch64-unknown-linux-gnu,
41+
RUNNER: ubuntu-24.04-arm
42+
}
43+
- {
44+
NAME: x86_64-linux,
45+
TARGET: x86_64-unknown-linux-gnu,
46+
RUNNER: ubuntu-latest
47+
}
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v5
51+
52+
- name: Get version info
53+
id: version
54+
run: |
55+
SHORT_SHA=$(git rev-parse --short HEAD)
56+
echo "version=nightly-${SHORT_SHA}" >> $GITHUB_OUTPUT
57+
58+
- name: Install dependencies
59+
shell: bash
60+
run: |
61+
sudo apt update -y
62+
sudo apt install b3sum findutils file -y
63+
64+
- name: Install Rust toolchain
65+
uses: dtolnay/rust-toolchain@stable
66+
with:
67+
targets: ${{ matrix.build.TARGET }}
68+
69+
- name: Build
70+
run: cargo build --release --locked --target "${{ matrix.build.TARGET }}" --jobs="$(($(nproc)+1))" --verbose
71+
72+
- name: Prepare release assets
73+
shell: bash
74+
run: |
75+
mkdir -p release
76+
cp {LICENSE,README.md} release/
77+
cp "target/${{ matrix.build.TARGET }}/release/aeris" release/
78+
79+
- name: Create release artifacts
80+
env:
81+
ARTIFACT: "aeris-${{ matrix.build.NAME }}"
82+
shell: bash
83+
run: |
84+
cp release/aeris "${ARTIFACT}"
85+
b3sum "${ARTIFACT}" > "${ARTIFACT}.b3sum"
86+
87+
tar -czvf "${ARTIFACT}.tar.gz" release/
88+
b3sum "${ARTIFACT}.tar.gz" > "${ARTIFACT}.tar.gz.b3sum"
89+
bash -c 'realpath "${ARTIFACT}" ; realpath "${ARTIFACT}.tar.gz"' | xargs -I "{}" bash -c \
90+
'printf "\nFile: $(basename {})\n Type: $(file -b {})\n B3sum: $(b3sum {} | cut -d" " -f1)\n SHA256sum: $(sha256sum {} | cut -d" " -f1)\n Size: $(du -bh {} | cut -f1)\n"'
91+
92+
- name: Publish to GitHub (nightly)
93+
uses: svenstaro/upload-release-action@v2
94+
with:
95+
repo_token: ${{ secrets.GITHUB_TOKEN }}
96+
file: aeris-${{ matrix.build.NAME }}*
97+
file_glob: true
98+
overwrite: true
99+
tag: nightly
100+
release_name: "${{ steps.version.outputs.version }}"
101+
prerelease: true
102+
103+
- name: Attest Build Provenance
104+
uses: actions/attest-build-provenance@v3.0.0
105+
with:
106+
subject-name: "aeris-nightly-${{ matrix.build.NAME }}"
107+
subject-path: |
108+
aeris-${{ matrix.build.NAME }}*
109+
show-summary: true

0 commit comments

Comments
 (0)