Skip to content

Commit 20420e4

Browse files
committed
feat: add canary release
Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com>
1 parent 7e71d36 commit 20420e4

1 file changed

Lines changed: 29 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Release
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
68
- 'v*'
79

@@ -48,21 +50,17 @@ jobs:
4850
uses: actions/checkout@v6
4951

5052
- name: Setup Rust
51-
uses: dtolnay/rust-toolchain@stable
52-
with:
53-
targets: ${{ matrix.target }}
53+
run: |
54+
rustup update stable --no-self-update
55+
rustup default stable
56+
rustup target add ${{ matrix.target }}
5457
5558
- name: Install cross-compilation tools (Linux aarch64)
5659
if: matrix.target == 'aarch64-unknown-linux-gnu'
5760
run: |
5861
sudo apt-get update
5962
sudo apt-get install -y gcc-aarch64-linux-gnu
6063
61-
- name: Cache Rust
62-
uses: Swatinem/rust-cache@v2
63-
with:
64-
key: ${{ matrix.target }}
65-
6664
- name: Build binary
6765
run: cargo build --release --target ${{ matrix.target }}
6866
env:
@@ -119,7 +117,29 @@ jobs:
119117
cd release
120118
sha256sum * > checksums.txt
121119
122-
- name: Create Release
120+
- name: Create Release (tagged)
121+
if: startsWith(github.ref, 'refs/tags/')
123122
run: gh release create --generate-notes ${{ github.ref_name }} release/*
124123
env:
125124
GH_TOKEN: ${{ github.token }}
125+
126+
- name: Create/Update Canary Release
127+
if: github.ref == 'refs/heads/main'
128+
run: |
129+
# Delete existing canary release if it exists
130+
gh release delete canary --yes || true
131+
# Delete existing canary tag if it exists
132+
git push origin :refs/tags/canary || true
133+
# Create new canary release
134+
gh release create canary \
135+
--title "Canary Release" \
136+
--notes "**This is an unstable canary release built from the latest \`main\` branch.**
137+
138+
Commit: ${{ github.sha }}
139+
Built: $(date -u +'%Y-%m-%d %H:%M:%S UTC')
140+
141+
This release is automatically updated on every push to \`main\`. Use tagged releases for stable versions." \
142+
--prerelease \
143+
release/*
144+
env:
145+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)