Skip to content

Commit 011fd01

Browse files
committed
ci: publish both tar.xz and onelf on nightly and release
1 parent 6ee7c86 commit 011fd01

2 files changed

Lines changed: 70 additions & 37 deletions

File tree

.github/workflows/nightly.yaml

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,67 +28,88 @@ jobs:
2828
gh release delete nightly --cleanup-tag || true
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
3132
publish-nightly:
3233
name: Publish nightly binaries
34+
needs: remove-nightly-tag
3335
runs-on: ${{ matrix.build.RUNNER }}
36+
container:
37+
image: ${{ matrix.build.IMAGE }}
3438
strategy:
3539
fail-fast: false
3640
matrix:
3741
build:
3842
- {
39-
NAME: aarch64-linux-gnu,
40-
TARGET: aarch64-unknown-linux-gnu,
41-
RUNNER: ubuntu-24.04-arm
43+
NAME: x86_64-linux,
44+
RUNNER: ubuntu-latest,
45+
IMAGE: "archlinux:latest",
46+
ONELF: onelf-x86_64-linux,
47+
VULKAN_DRIVERS: "vulkan-swrast vulkan-radeon vulkan-intel vulkan-nouveau",
4248
}
4349
- {
44-
NAME: x86_64-linux-gnu,
45-
TARGET: x86_64-unknown-linux-gnu,
46-
RUNNER: ubuntu-latest
50+
NAME: aarch64-linux,
51+
RUNNER: ubuntu-24.04-arm,
52+
IMAGE: "menci/archlinuxarm:latest",
53+
ONELF: onelf-aarch64-linux,
54+
VULKAN_DRIVERS: "vulkan-swrast vulkan-radeon vulkan-nouveau vulkan-panfrost vulkan-broadcom",
4755
}
4856
steps:
57+
- name: Install dependencies
58+
shell: bash
59+
run: |
60+
pacman -Syu --noconfirm --needed \
61+
base-devel git curl tar xz b3sum rust patchelf \
62+
pkgconf fontconfig freetype2 \
63+
libxcb libxkbcommon libxkbcommon-x11 \
64+
wayland mesa vulkan-icd-loader vulkan-headers \
65+
${{ matrix.build.VULKAN_DRIVERS }} \
66+
alsa-lib
67+
4968
- name: Checkout
5069
uses: actions/checkout@v5
5170

5271
- name: Get version info
5372
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
5973
shell: bash
6074
run: |
61-
sudo apt update -y
62-
sudo apt install -y \
63-
b3sum findutils file \
64-
libxcb1-dev libxkbcommon-dev libxkbcommon-x11-dev \
65-
libfontconfig1-dev libwayland-dev libasound2-dev \
66-
libssl-dev pkg-config
67-
68-
- name: Install Rust toolchain
69-
uses: dtolnay/rust-toolchain@stable
70-
with:
71-
targets: ${{ matrix.build.TARGET }}
75+
echo "version=nightly-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
7276
7377
- name: Build
74-
run: cargo build --release --locked --target "${{ matrix.build.TARGET }}" --jobs="$(($(nproc)+1))" --verbose
78+
run: cargo build --release --locked --jobs "$(($(nproc)+1))"
7579

76-
- name: Prepare release assets
80+
- name: Create tarball
7781
shell: bash
7882
run: |
7983
mkdir -p release
80-
cp {LICENSE,README.md} release/
81-
cp "target/${{ matrix.build.TARGET }}/release/aeris" release/
84+
cp LICENSE README.md release/
85+
cp target/release/aeris release/
86+
tar -cJf "aeris-${{ matrix.build.NAME }}.tar.xz" release/
87+
b3sum "aeris-${{ matrix.build.NAME }}.tar.xz" \
88+
> "aeris-${{ matrix.build.NAME }}.tar.xz.b3sum"
8289
83-
- name: Create release artifacts
84-
env:
85-
ARTIFACT: "aeris-${{ matrix.build.NAME }}"
90+
- name: Fetch onelf
8691
shell: bash
8792
run: |
88-
tar -cJvf "${ARTIFACT}.tar.xz" release/
89-
b3sum "${ARTIFACT}.tar.xz" > "${ARTIFACT}.tar.xz.b3sum"
93+
curl -fsSL -o onelf \
94+
"https://github.com/QaidVoid/onelf/releases/latest/download/${{ matrix.build.ONELF }}"
95+
chmod +x onelf
96+
97+
- name: Pack with onelf
98+
shell: bash
99+
run: |
100+
mkdir -p AppDir/bin
101+
cp target/release/aeris AppDir/bin/aeris
102+
cp onelf.toml AppDir/onelf.toml
103+
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.version }}\"/" AppDir/onelf.toml
104+
./onelf build AppDir
105+
mv AppDir/aeris.onelf "aeris-${{ matrix.build.NAME }}.onelf"
106+
b3sum "aeris-${{ matrix.build.NAME }}.onelf" > "aeris-${{ matrix.build.NAME }}.onelf.b3sum"
107+
108+
- name: Verify pack
109+
run: ./onelf verify "aeris-${{ matrix.build.NAME }}.onelf"
90110

91111
- name: Publish to GitHub (nightly)
112+
if: ${{ !env.ACT }}
92113
uses: svenstaro/upload-release-action@v2
93114
with:
94115
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -99,10 +120,11 @@ jobs:
99120
release_name: "${{ steps.version.outputs.version }}"
100121
prerelease: true
101122

102-
- name: Attest Build Provenance
123+
- name: Attest build provenance
124+
if: ${{ !env.ACT }}
103125
uses: actions/attest-build-provenance@v3.0.0
104126
with:
105-
subject-name: "aeris-nightly-${{ matrix.build.NAME }}"
106127
subject-path: |
107-
aeris-${{ matrix.build.NAME }}*
128+
aeris-${{ matrix.build.NAME }}.tar.xz
129+
aeris-${{ matrix.build.NAME }}.onelf
108130
show-summary: true

.github/workflows/release.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ jobs:
5959
- name: Build
6060
run: cargo build --release --locked --jobs "$(($(nproc)+1))"
6161

62+
- name: Create tarball
63+
shell: bash
64+
run: |
65+
mkdir -p release
66+
cp LICENSE README.md release/
67+
cp target/release/aeris release/
68+
tar -cJf "aeris-${{ matrix.build.NAME }}.tar.xz" release/
69+
b3sum "aeris-${{ matrix.build.NAME }}.tar.xz" \
70+
> "aeris-${{ matrix.build.NAME }}.tar.xz.b3sum"
71+
6272
- name: Fetch onelf
6373
shell: bash
6474
run: |
@@ -86,7 +96,7 @@ jobs:
8696
uses: svenstaro/upload-release-action@v2
8797
with:
8898
repo_token: ${{ secrets.GITHUB_TOKEN }}
89-
file: aeris-${{ matrix.build.NAME }}.onelf*
99+
file: aeris-${{ matrix.build.NAME }}*
90100
file_glob: true
91101
overwrite: true
92102
tag: ${{ github.ref }}
@@ -95,6 +105,7 @@ jobs:
95105
if: ${{ !env.ACT }}
96106
uses: actions/attest-build-provenance@v3.0.0
97107
with:
98-
subject-name: "aeris-${{ matrix.build.NAME }}.onelf"
99-
subject-path: "aeris-${{ matrix.build.NAME }}.onelf"
108+
subject-path: |
109+
aeris-${{ matrix.build.NAME }}.tar.xz
110+
aeris-${{ matrix.build.NAME }}.onelf
100111
show-summary: true

0 commit comments

Comments
 (0)