Skip to content

Commit 891de8e

Browse files
committed
modifie release workflow
1 parent fe3493f commit 891de8e

File tree

2 files changed

+142
-1
lines changed

2 files changed

+142
-1
lines changed

.github/workflows/build.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build-posix:
11+
name: Build (Linux & macOS)
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: "1.24"
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: "24"
27+
cache: "npm"
28+
cache-dependency-path: frontend/package-lock.json
29+
30+
- name: Install frontend dependencies
31+
run: |
32+
cd frontend
33+
npm ci
34+
35+
- name: Build frontend
36+
run: |
37+
cd frontend
38+
npm run build
39+
40+
- name: Create output directory
41+
run: mkdir -p dist
42+
43+
- name: Build for macOS ARM64
44+
env:
45+
GOOS: darwin
46+
GOARCH: arm64
47+
run: |
48+
mkdir -p dist/macos-arm64
49+
go build -o dist/macos-arm64/go-irl
50+
51+
- name: Build for Linux x64
52+
env:
53+
GOOS: linux
54+
GOARCH: amd64
55+
run: |
56+
mkdir -p dist/linux-x64
57+
go build -o dist/linux-x64/go-irl
58+
59+
- name: Build for Linux ARM64
60+
env:
61+
GOOS: linux
62+
GOARCH: arm64
63+
run: |
64+
mkdir -p dist/linux-arm64
65+
go build -o dist/linux-arm64/go-irl
66+
67+
- name: Make POSIX binaries executable
68+
run: |
69+
chmod +x dist/macos-arm64/go-irl
70+
chmod +x dist/linux-x64/go-irl
71+
chmod +x dist/linux-arm64/go-irl
72+
73+
- name: Create ZIP archives
74+
run: |
75+
cd dist
76+
zip -j go-irl-macos-arm64.zip macos-arm64/go-irl ../README.md
77+
zip -j go-irl-linux-x64.zip linux-x64/go-irl ../README.md
78+
zip -j go-irl-linux-arm64.zip linux-arm64/go-irl ../README.md
79+
80+
- name: Upload artifacts
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: posix-zips
84+
path: dist/*.zip
85+
86+
build-windows:
87+
name: Build Windows x64
88+
runs-on: windows-latest
89+
90+
steps:
91+
- name: Checkout code
92+
uses: actions/checkout@v4
93+
94+
- name: Setup Go
95+
uses: actions/setup-go@v4
96+
with:
97+
go-version: "1.24"
98+
99+
- name: Setup Node.js
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: "24"
103+
cache: "npm"
104+
cache-dependency-path: frontend/package-lock.json
105+
106+
- name: Install frontend dependencies
107+
run: |
108+
cd frontend
109+
npm ci
110+
111+
- name: Build frontend
112+
run: |
113+
cd frontend
114+
npm run build
115+
116+
- name: Create output directory
117+
run: mkdir dist
118+
119+
- name: Build for Windows x64
120+
env:
121+
GOOS: windows
122+
GOARCH: amd64
123+
run: |
124+
mkdir dist\windows-x64
125+
go build -o dist\windows-x64\go-irl.exe
126+
Compress-Archive -Path dist\windows-x64\go-irl.exe, README.md -DestinationPath dist\go-irl-windows-x64.zip
127+
128+
- name: Upload artifacts
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: windows-zip
132+
path: dist/go-irl-windows-x64.zip

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@ on:
44
push:
55
tags:
66
- "v*"
7-
workflow_dispatch:
87

98
permissions:
109
contents: write
1110

1211
jobs:
12+
approval:
13+
name: Approval Required
14+
runs-on: ubuntu-latest
15+
environment: release
16+
17+
steps:
18+
- name: Manual approval checkpoint
19+
run: echo "Release approved for ${{ github.ref_name }}"
1320
build-posix:
1421
name: Build (Linux & macOS)
1522
runs-on: ubuntu-latest
23+
needs: approval
1624

1725
steps:
1826
- name: Checkout code
@@ -89,6 +97,7 @@ jobs:
8997
build-windows:
9098
name: Build Windows x64
9199
runs-on: windows-latest
100+
needs: approval
92101

93102
steps:
94103
- name: Checkout code

0 commit comments

Comments
 (0)