@@ -3,7 +3,10 @@ name: Create Release (multi-platform)
33on :
44 push :
55 tags :
6- - ' v*' # e.g. v1.7.0
6+ - ' v*' # e.g. v1.8.10
7+
8+ permissions :
9+ contents : write # needed for gh-release upload
710
811jobs :
912 build :
@@ -17,17 +20,17 @@ jobs:
1720 py : ' 3.12.10'
1821 sep : ' ;'
1922 icon_arg : ' --icon src/assets/logo-icon.ico --windowed'
20- asset_name : telemetry-windows.zip
23+ artifact : telemetry-windows.zip
2124 - os : macos-latest
2225 py : ' 3.12.10'
2326 sep : ' :'
24- icon_arg : ' --windowed' # add --icon src/assets/app.icns if you have one
25- asset_name : telemetry-macos.zip
27+ icon_arg : ' --windowed' # or: --icon src/assets/app.icns --windowed
28+ artifact : telemetry-macos.zip
2629 - os : ubuntu-latest
2730 py : ' 3.12.10'
2831 sep : ' :'
2932 icon_arg : ' '
30- asset_name : telemetry-linux.zip
33+ artifact : telemetry-linux.zip
3134
3235 steps :
3336 - name : Checkout
@@ -38,14 +41,15 @@ jobs:
3841 with :
3942 python-version : ${{ matrix.py }}
4043
41- - name : Install deps
44+ - name : Install dependencies
4245 shell : bash
4346 run : |
47+ set -euo pipefail
4448 python -m pip install --upgrade pip
4549 if [ -f requirements.txt ]; then pip install -r requirements.txt; else pip install -r requirement.txt; fi
4650 pip install pyinstaller==6.16.0 tufup
4751
48- - name : Build (PyInstaller --onedir)
52+ - name : Build executable (PyInstaller --onedir)
4953 shell : bash
5054 run : |
5155 set -euo pipefail
@@ -87,19 +91,20 @@ jobs:
8791 --add-data "src/Version.py${{ matrix.sep }}." \
8892 "${COLLECT_FLAGS[@]}"
8993
90- - name : Package (zip the onedir folder)
94+ - name : Package onedir as zip
9195 shell : bash
9296 run : |
9397 set -euo pipefail
9498 mkdir -p out
95- # dist/telemetry is a folder on all OSes with --onedir
99+ # dist/telemetry/ exists on all OS with --onedir
96100 if [ "${{ matrix.os }}" = "windows-latest" ]; then
97- 7z a -tzip "out/${{ matrix.asset_name }}" "./dist/telemetry/*"
101+ 7z a -tzip "out/${{ matrix.artifact }}" "./dist/telemetry/*" >/dev/null
98102 else
99- (cd dist && zip -r "../out/${{ matrix.asset_name }}" telemetry)
103+ (cd dist && zip -qr "../out/${{ matrix.artifact }}" telemetry)
100104 fi
105+ ls -la out
101106
102- - name : Upload artifact (zipped app)
107+ - name : Upload artifact
103108 uses : actions/upload-artifact@v4
104109 with :
105110 name : built-${{ matrix.os }}
@@ -112,7 +117,7 @@ jobs:
112117 needs : [build]
113118
114119 steps :
115- - name : Checkout (keys, scripts)
120+ - name : Checkout (keys, scripts, build_tuf_repo.py )
116121 uses : actions/checkout@v4
117122
118123 - name : Set up Python
@@ -123,22 +128,36 @@ jobs:
123128 - name : Install tufup
124129 run : pip install tufup
125130
126- - name : Download artifacts
131+ - name : Download all build artifacts
127132 uses : actions/download-artifact@v4
128133 with :
129134 path : artifacts
130135 merge-multiple : true
131136
132- - name : Verify expected files
137+ - name : Prepare bundles for TUF (extract zips)
133138 shell : bash
134139 run : |
135140 set -euo pipefail
136141 ls -la artifacts
137- test -f artifacts/telemetry-windows.zip
138- test -f artifacts/telemetry-macos.zip
139- test -f artifacts/telemetry-linux.zip
142+ mkdir -p bundles/windows bundles/macos bundles/linux
143+
144+ extract () {
145+ src="$1"; dst="$2"
146+ case "$src" in
147+ *.zip) unzip -q "$src" -d "$dst" ;;
148+ *.tar.gz|*.tgz) tar -xzf "$src" -C "$dst" ;;
149+ *) echo "Unsupported archive: $src"; exit 2 ;;
150+ esac
151+ }
152+
153+ extract artifacts/telemetry-windows.zip bundles/windows
154+ extract artifacts/telemetry-macos.zip bundles/macos
155+ extract artifacts/telemetry-linux.zip bundles/linux
156+
157+ echo "Bundle contents:"
158+ find bundles -maxdepth 2 -type f | sed 's/^/ /'
140159
141- - name : Write signing keys (secrets or fallback)
160+ - name : Write signing keys (from secrets or fallback)
142161 env :
143162 TUF_KEY_TARGETS_JSON_B64 : ${{ secrets.TUF_KEY_TARGETS_JSON_B64 }}
144163 TUF_KEY_SNAPSHOT_JSON_B64 : ${{ secrets.TUF_KEY_SNAPSHOT_JSON_B64 }}
@@ -159,19 +178,13 @@ jobs:
159178 src/updater/keys/snapshot \
160179 src/updater/keys/timestamp
161180
162- - name : Stage TUF targets
163- shell : bash
164- run : |
165- set -euo pipefail
166- mkdir -p release/targets
167- cp artifacts/telemetry-*.zip release/targets/
168-
169- - name : Build TUF repo
181+ - name : Build TUF repo (creates release/metadata + release/targets/*.tar.gz)
170182 shell : bash
171183 env :
172- TAG : ${{ github.ref_name }} # e.g., v1.7.0
184+ TAG : ${{ github.ref_name }} # e.g., v1.8.10
173185 run : |
174186 set -euo pipefail
187+ echo "VERSION=${TAG#v}"
175188 python scripts/build_tuf_repo.py
176189
177190 - name : Show release payload
@@ -180,7 +193,7 @@ jobs:
180193 echo "::group::Metadata"; ls -la release/metadata; echo "::endgroup::"
181194 echo "::group::Targets"; ls -la release/targets; echo "::endgroup::"
182195
183- - name : Create GitHub Release
196+ - name : Create GitHub Release (TUF metadata + targets)
184197 uses : softprops/action-gh-release@v2
185198 with :
186199 files : |
0 commit comments