11# Release workflow for cargo-rail
22#
3- # Triggered by pushing a version tag (v1.0 .0, v1.2.3 , etc.)
3+ # Triggered by pushing a version tag (v0.1 .0, v1.0.0 , etc.)
44#
5- # This workflow:
6- # 1. Creates a GitHub Release with CHANGELOG content
7- # 2. Builds pre-built binaries for 9 targets
8- # 3. Uploads binaries to the release
9- #
10- # The actual version bump, changelog generation, and tagging is done locally
11- # using `cargo rail release run cargo-rail --bump <version>`.
5+ # This workflow builds pre-built binaries and uploads them to GitHub Releases.
6+ # The version bump, changelog, tagging, and crates.io publish are done locally
7+ # via `cargo rail release run cargo-rail --bump <version>`.
128#
139# Workflow:
14- # LOCAL: cargo rail release run cargo-rail --bump 1.0 .0
10+ # LOCAL: cargo rail release run cargo-rail --bump 0.1 .0
1511# git push origin main --follow-tags
16- # CI: This workflow triggers, builds binaries, creates release
12+ # CI: This workflow triggers, builds binaries, attaches to release
1713
1814name : Release
1915
@@ -39,18 +35,12 @@ jobs:
3935 runs-on : ubuntu-latest
4036 permissions :
4137 contents : write
42- outputs :
43- version : ${{ steps.version.outputs.version }}
4438 steps :
4539 - name : Checkout
4640 uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4741 with :
4842 persist-credentials : false
4943
50- - name : Extract version from tag
51- id : version
52- run : echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
53-
5444 - name : Create GitHub Release
5545 uses : taiki-e/create-gh-release-action@b7abb0cf5e72cb5500307b577f9ca3fd4c5be9d2 # v1.8.4
5646 with :
@@ -67,51 +57,34 @@ jobs:
6757 fail-fast : false
6858 matrix :
6959 include :
70- # ----------------------------------------------------------------
71- # Linux
72- # ----------------------------------------------------------------
73- # x86_64 glibc - most common Linux target
60+ # Linux x86_64 (glibc)
7461 - target : x86_64-unknown-linux-gnu
7562 os : ubuntu-22.04
7663
77- # x86_64 musl - static binary, maximum portability
64+ # Linux x86_64 ( musl) - static, portable
7865 - target : x86_64-unknown-linux-musl
7966 os : ubuntu-latest
8067
81- # ARM64 glibc - AWS Graviton, modern ARM servers
68+ # Linux ARM64 ( glibc)
8269 - target : aarch64-unknown-linux-gnu
8370 os : ubuntu-22.04
8471
85- # ARM64 musl - static binary for ARM
72+ # Linux ARM64 ( musl) - static, portable
8673 - target : aarch64-unknown-linux-musl
8774 os : ubuntu-latest
8875
89- # ----------------------------------------------------------------
90- # macOS
91- # ----------------------------------------------------------------
92- # Intel Macs
93- - target : x86_64-apple-darwin
94- os : macos-14
95-
96- # Apple Silicon (M1/M2/M3)
97- - target : aarch64-apple-darwin
98- os : macos-14
99-
100- # Universal binary (both architectures)
101- - target : universal-apple-darwin
102- os : macos-14
103-
104- # ----------------------------------------------------------------
105- # Windows
106- # ----------------------------------------------------------------
107- # x86_64 Windows
76+ # Windows x86_64
10877 - target : x86_64-pc-windows-msvc
10978 os : windows-2022
11079
111- # ARM64 Windows (Surface Pro X, etc.)
80+ # Windows ARM64
11281 - target : aarch64-pc-windows-msvc
11382 os : windows-2022
11483
84+ # macOS ARM64 (Apple Silicon)
85+ - target : aarch64-apple-darwin
86+ os : macos-14
87+
11588 runs-on : ${{ matrix.os }}
11689 timeout-minutes : 60
11790 permissions :
@@ -144,42 +117,16 @@ jobs:
144117 run : echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "$GITHUB_ENV"
145118 shell : bash
146119
147- # macOS deployment targets for compatibility
148- - name : Set macOS deployment target (Intel)
149- if : matrix.target == 'x86_64-apple-darwin'
150- run : echo "MACOSX_DEPLOYMENT_TARGET=10.12" >> "$GITHUB_ENV"
151-
152- - name : Set macOS deployment target (ARM/Universal)
153- if : matrix.target == 'aarch64-apple-darwin' || matrix.target == 'universal-apple-darwin'
120+ # macOS deployment target
121+ - name : Set macOS deployment target
122+ if : matrix.target == 'aarch64-apple-darwin'
154123 run : echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV"
155124
156125 - name : Build and upload binary
157126 uses : taiki-e/upload-rust-binary-action@e7953b6078194a4ae5f5619632e3715db6275561 # v1.24.0
158127 with :
159128 bin : cargo-rail
160129 target : ${{ matrix.target }}
161- # tar for all platforms, zip additionally for Windows
162130 tar : all
163131 zip : windows
164132 token : ${{ secrets.GITHUB_TOKEN }}
165-
166- # ==========================================================================
167- # Job 3: Publish to crates.io (after binaries are built)
168- # ==========================================================================
169- publish :
170- name : Publish to crates.io
171- needs : [create-release, upload-assets]
172- runs-on : ubuntu-latest
173- steps :
174- - name : Checkout
175- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
176- with :
177- persist-credentials : false
178-
179- - name : Install Rust
180- uses : dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e # master
181- with :
182- toolchain : stable
183-
184- - name : Publish to crates.io
185- run : cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}"
0 commit comments