Skip to content

Commit 3f5cc21

Browse files
committed
cli release workflow will automatically create a new release
1 parent 63632a9 commit 3f5cc21

File tree

1 file changed

+180
-140
lines changed

1 file changed

+180
-140
lines changed

.github/workflows/release-cli.yml

Lines changed: 180 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -2,145 +2,185 @@ name: Release CLI
22

33
# Manual trigger from the GitHub UI
44
on:
5-
workflow_dispatch: {}
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: "Version number (e.g., 0.4.0)"
9+
required: true
10+
type: string
611

712
jobs:
8-
build-linux-x86_64:
9-
name: Build (Linux)
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
15-
- name: Install Rust
16-
uses: actions-rs/toolchain@v1
17-
with:
18-
toolchain: stable
19-
20-
- name: Add target
21-
run: rustup target add x86_64-unknown-linux-gnu
22-
23-
- name: Build x86_64-unknown-linux-gnu
24-
run: cargo build --package jcg --profile cli --target x86_64-unknown-linux-gnu
25-
26-
- name: Upload artifact (Linux)
27-
uses: actions/upload-artifact@v4
28-
with:
29-
name: jcg-x86_64-unknown-linux-gnu
30-
path: target/x86_64-unknown-linux-gnu/cli/jcg*
31-
32-
build-linux-arm64:
33-
name: Build (Linux ARM64)
34-
runs-on: ubuntu-24.04-arm
35-
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v4
38-
39-
- name: Install Rust
40-
uses: actions-rs/toolchain@v1
41-
with:
42-
toolchain: stable
43-
44-
- name: Add target
45-
run: rustup target add aarch64-unknown-linux-gnu
46-
47-
- name: Build aarch64-unknown-linux-gnu
48-
run: cargo build --package jcg --profile cli --target aarch64-unknown-linux-gnu
49-
50-
- name: Upload artifact (Linux)
51-
uses: actions/upload-artifact@v4
52-
with:
53-
name: jcg-aarch64-unknown-linux-gnu
54-
path: target/aarch64-unknown-linux-gnu/cli/jcg*
55-
56-
# Windows MSVC (x86_64 + i686)
57-
build-windows-x86:
58-
name: Build (Windows MSVC)
59-
runs-on: windows-latest
60-
steps:
61-
- name: Checkout
62-
uses: actions/checkout@v4
63-
64-
- name: Install Rust
65-
uses: actions-rs/toolchain@v1
66-
with:
67-
toolchain: stable
68-
69-
- name: Add MSVC targets
70-
run: rustup target add x86_64-pc-windows-msvc i686-pc-windows-msvc
71-
72-
- name: Build x86_64-pc-windows-msvc
73-
run: cargo build --package jcg --profile cli --target x86_64-pc-windows-msvc
74-
75-
- name: Build i686-pc-windows-msvc
76-
run: cargo build --package jcg --profile cli --target i686-pc-windows-msvc
77-
78-
- name: Upload x86_64 Windows artifact
79-
uses: actions/upload-artifact@v4
80-
with:
81-
name: jcg-x86_64-pc-windows-msvc
82-
path: target/x86_64-pc-windows-msvc/cli/jcg*.exe
83-
84-
- name: Upload i686 Windows artifact
85-
uses: actions/upload-artifact@v4
86-
with:
87-
name: jcg-i686-pc-windows-msvc
88-
path: target/i686-pc-windows-msvc/cli/jcg*.exe
89-
90-
build-windows-arm64:
91-
name: Build (Windows ARM64 MSVC)
92-
runs-on: windows-11-arm
93-
steps:
94-
- name: Checkout
95-
uses: actions/checkout@v4
96-
97-
- name: Install Rust
98-
uses: actions-rs/toolchain@v1
99-
with:
100-
toolchain: stable
101-
102-
- name: Add ARM64 MSVC target
103-
run: rustup target add aarch64-pc-windows-msvc
104-
105-
- name: Build aarch64-pc-windows-msvc
106-
run: cargo build --package jcg --profile cli --target aarch64-pc-windows-msvc
107-
108-
- name: Upload ARM64 Windows artifact
109-
uses: actions/upload-artifact@v4
110-
with:
111-
name: jcg-aarch64-pc-windows-msvc
112-
path: target/aarch64-pc-windows-msvc/cli/jcg*.exe
113-
114-
# macOS (x86_64 + aarch64)
115-
build-macos:
116-
name: Build (macOS)
117-
runs-on: macos-latest
118-
steps:
119-
- name: Checkout
120-
uses: actions/checkout@v4
121-
122-
- name: Install Rust
123-
uses: actions-rs/toolchain@v1
124-
with:
125-
toolchain: stable
126-
127-
- name: Add macOS targets
128-
run: rustup target add x86_64-apple-darwin aarch64-apple-darwin
129-
130-
- name: Build x86_64-apple-darwin
131-
run: cargo build --package jcg --profile cli --target x86_64-apple-darwin
132-
133-
- name: Build aarch64-apple-darwin
134-
run: cargo build --package jcg --profile cli --target aarch64-apple-darwin
135-
136-
- name: Upload x86_64 macOS artifact
137-
uses: actions/upload-artifact@v4
138-
with:
139-
name: jcg-x86_64-apple-darwin
140-
path: target/x86_64-apple-darwin/cli/jcg*
141-
142-
- name: Upload aarch64 macOS artifact
143-
uses: actions/upload-artifact@v4
144-
with:
145-
name: jcg-aarch64-apple-darwin
146-
path: target/aarch64-apple-darwin/cli/jcg*
13+
build-linux-x86_64:
14+
name: Build (Linux)
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
25+
- name: Add target
26+
run: rustup target add x86_64-unknown-linux-gnu
27+
28+
- name: Build x86_64-unknown-linux-gnu
29+
run: cargo build --package jcg --profile cli --target x86_64-unknown-linux-gnu
30+
31+
- name: Upload artifact (Linux)
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: jcg-x86_64-unknown-linux-gnu
35+
path: target/x86_64-unknown-linux-gnu/cli/jcg*
36+
37+
build-linux-arm64:
38+
name: Build (Linux ARM64)
39+
runs-on: ubuntu-24.04-arm
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Install Rust
45+
uses: actions-rs/toolchain@v1
46+
with:
47+
toolchain: stable
48+
49+
- name: Add target
50+
run: rustup target add aarch64-unknown-linux-gnu
51+
52+
- name: Build aarch64-unknown-linux-gnu
53+
run: cargo build --package jcg --profile cli --target aarch64-unknown-linux-gnu
54+
55+
- name: Upload artifact (Linux)
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: jcg-aarch64-unknown-linux-gnu
59+
path: target/aarch64-unknown-linux-gnu/cli/jcg*
60+
61+
# Windows MSVC (x86_64 + i686)
62+
build-windows-x86:
63+
name: Build (Windows MSVC)
64+
runs-on: windows-latest
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Install Rust
70+
uses: actions-rs/toolchain@v1
71+
with:
72+
toolchain: stable
73+
74+
- name: Add MSVC targets
75+
run: rustup target add x86_64-pc-windows-msvc i686-pc-windows-msvc
76+
77+
- name: Build x86_64-pc-windows-msvc
78+
run: cargo build --package jcg --profile cli --target x86_64-pc-windows-msvc
79+
80+
- name: Build i686-pc-windows-msvc
81+
run: cargo build --package jcg --profile cli --target i686-pc-windows-msvc
82+
83+
- name: Upload x86_64 Windows artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: jcg-x86_64-pc-windows-msvc
87+
path: target/x86_64-pc-windows-msvc/cli/jcg*.exe
88+
89+
- name: Upload i686 Windows artifact
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: jcg-i686-pc-windows-msvc
93+
path: target/i686-pc-windows-msvc/cli/jcg*.exe
94+
95+
build-windows-arm64:
96+
name: Build (Windows ARM64 MSVC)
97+
runs-on: windows-11-arm
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
102+
- name: Install Rust
103+
uses: actions-rs/toolchain@v1
104+
with:
105+
toolchain: stable
106+
107+
- name: Add ARM64 MSVC target
108+
run: rustup target add aarch64-pc-windows-msvc
109+
110+
- name: Build aarch64-pc-windows-msvc
111+
run: cargo build --package jcg --profile cli --target aarch64-pc-windows-msvc
112+
113+
- name: Upload ARM64 Windows artifact
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: jcg-aarch64-pc-windows-msvc
117+
path: target/aarch64-pc-windows-msvc/cli/jcg*.exe
118+
119+
# macOS (x86_64 + aarch64)
120+
build-macos:
121+
name: Build (macOS)
122+
runs-on: macos-latest
123+
steps:
124+
- name: Checkout
125+
uses: actions/checkout@v4
126+
127+
- name: Install Rust
128+
uses: actions-rs/toolchain@v1
129+
with:
130+
toolchain: stable
131+
132+
- name: Add macOS targets
133+
run: rustup target add x86_64-apple-darwin aarch64-apple-darwin
134+
135+
- name: Build x86_64-apple-darwin
136+
run: cargo build --package jcg --profile cli --target x86_64-apple-darwin
137+
138+
- name: Build aarch64-apple-darwin
139+
run: cargo build --package jcg --profile cli --target aarch64-apple-darwin
140+
141+
- name: Upload x86_64 macOS artifact
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: jcg-x86_64-apple-darwin
145+
path: target/x86_64-apple-darwin/cli/jcg*
146+
147+
- name: Upload aarch64 macOS artifact
148+
uses: actions/upload-artifact@v4
149+
with:
150+
name: jcg-aarch64-apple-darwin
151+
path: target/aarch64-apple-darwin/cli/jcg*
152+
153+
create-release:
154+
name: Create GitHub Release
155+
needs:
156+
- build-linux-x86_64
157+
- build-linux-arm64
158+
- build-windows-x86
159+
- build-windows-arm64
160+
- build-macos
161+
runs-on: ubuntu-latest
162+
permissions:
163+
contents: write
164+
steps:
165+
- name: Download all artifacts
166+
uses: actions/download-artifact@v4
167+
with:
168+
path: artifacts
169+
170+
- name: Create Release
171+
uses: softprops/action-gh-release@v1
172+
with:
173+
tag_name: cli-v${{ github.event.inputs.version }}
174+
name: CLI v${{ github.event.inputs.version }}
175+
draft: false
176+
prerelease: false
177+
files: |
178+
artifacts/jcg-x86_64-unknown-linux-gnu/*
179+
artifacts/jcg-aarch64-unknown-linux-gnu/*
180+
artifacts/jcg-x86_64-pc-windows-msvc/*
181+
artifacts/jcg-i686-pc-windows-msvc/*
182+
artifacts/jcg-aarch64-pc-windows-msvc/*
183+
artifacts/jcg-x86_64-apple-darwin/*
184+
artifacts/jcg-aarch64-apple-darwin/*
185+
env:
186+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)