This repository was archived by the owner on May 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (132 loc) · 5.26 KB
/
release.yml
File metadata and controls
150 lines (132 loc) · 5.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Release
# Triggered when a semver tag (v1.0.0, v1.2.3-beta) is pushed.
# Builds the Windows .exe and macOS .pkg in parallel on platform-native
# runners, then attaches both to the GitHub Release for that tag (creating
# the Release if the tag was pushed without one).
on:
push:
tags:
- "v*.*.*"
# Also allow a manual trigger from the Actions tab for dry runs.
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g. v1.0.0). Required for workflow_dispatch."
required: true
type: string
permissions:
# Needed so the release job can create / upload to a Release.
contents: write
jobs:
build-windows:
name: Build Windows .exe
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Inno Setup
# chocolatey is preinstalled on windows-latest runners.
run: choco install -y innosetup
- name: Install unofficial ChineseSimplified.isl
# The chocolatey Inno Setup package ships official language packs
# only; installer.iss also loads the unofficial ChineseSimplified.isl,
# which must be dropped into the Languages/ folder manually. Source:
# https://github.com/jrsoftware/issrc/tree/main/Files/Languages/Unofficial
shell: pwsh
run: |
$dest = 'C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl'
$url = 'https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl'
Invoke-WebRequest -Uri $url -OutFile $dest -UseBasicParsing
if (-not (Test-Path $dest)) { throw "Failed to download ChineseSimplified.isl" }
- name: Build installer
shell: pwsh
working-directory: windows
run: iscc installer.iss
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-exe
path: dist/AgentPack-*-windows-*.exe
if-no-files-found: error
build-macos:
name: Build macOS .pkg
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build .pkg
working-directory: macos
run: ./build-pkg.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos-pkg
path: dist/AgentPack-*-macos-*.pkg
if-no-files-found: error
release:
name: Create GitHub Release
needs: [build-windows, build-macos]
runs-on: ubuntu-latest
steps:
# Checkout full history + tags so build-release-notes.sh below can
# diff against the previous tag. linux/install.sh is also grabbed
# from this checkout and staged as a release asset (no build step —
# it bootstraps itself on the user's machine, same shape as the
# curl | bash one-liner in the README).
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: windows-exe
path: dist
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: macos-pkg
path: dist
- name: Resolve tag and version
id: tag
# On tag pushes, github.ref_name is the tag (e.g. v1.0.0).
# On workflow_dispatch, the user-supplied input is the tag.
# Also expose the bare version (no leading v) — build-pkg.sh and
# installer.iss both hard-code "1.0.0" internally and we match that.
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
tag="${{ inputs.tag }}"
else
tag="${{ github.ref_name }}"
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=${tag#v}" >> "$GITHUB_OUTPUT"
- name: Stage Linux installer
# Rename to AgentPack-<ver>-linux.sh so all three downloads share
# the same "AgentPack-<ver>-<platform>[-<arch>].<ext>" shape.
run: cp linux/install.sh "dist/AgentPack-${{ steps.tag.outputs.version }}-linux.sh"
- name: Generate checksums
working-directory: dist
# Cover all three platforms' downloads.
run: sha256sum AgentPack-* > SHA256SUMS
- name: Build release notes
# Delegates to scripts/build-release-notes.sh — same script is used
# by scripts/release.sh for local releases, so CI and manual
# releases produce identical notes. Honors a hand-written
# RELEASE_NOTES.md at repo root when present.
run: |
./scripts/build-release-notes.sh "${{ steps.tag.outputs.tag }}" > RELEASE_NOTES_BODY.md
echo "---- Release notes ----"
cat RELEASE_NOTES_BODY.md
- name: Create / update Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Agent Pack ${{ steps.tag.outputs.tag }}
body_path: RELEASE_NOTES_BODY.md
# fail_on_unmatched_files keeps us honest if a build artifact
# silently went missing before upload.
fail_on_unmatched_files: true
files: |
dist/AgentPack-*-windows-*.exe
dist/AgentPack-*-macos-*.pkg
dist/AgentPack-*-linux.sh
dist/SHA256SUMS