Skip to content

Commit 095d090

Browse files
release: the upload step could not match both archive shapes at once
Every job globbed `dist/*.tar.gz dist/*.zip dist/*.sha256`, so a unix job named a .zip that cannot exist and a Windows job named a .tar.gz that cannot — and gh fails on an unmatched pattern rather than skipping it. Four builds succeeded and then threw their artefacts away at the last step. Staging and dist are separate directories now, so `dist/*` contains artefacts and nothing else and the glob carries no platform knowledge. Windows also uses sha256sum rather than certutil, whose output is a three-line human report and not a checksum file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7cb3285 commit 095d090

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,40 +80,42 @@ jobs:
8080
cargo build --release --locked --manifest-path tools/indexer/Cargo.toml
8181
cargo build --release --locked --manifest-path tools/watcher/Cargo.toml
8282
83+
# Staging and dist are separate directories on purpose: the upload step globs
84+
# `dist/*`, so anything in there must be an artefact. Globbing by extension
85+
# instead means naming both .tar.gz and .zip on every platform, and gh fails
86+
# the job on the one that cannot match.
8387
- name: Package (unix)
8488
if: runner.os != 'Windows'
8589
shell: bash
8690
run: |
8791
set -euo pipefail
8892
name="mindex-cli-${{ matrix.target }}"
89-
mkdir -p "dist/$name"
90-
cp tools/indexer/target/release/mindex-index "dist/$name/"
91-
cp tools/watcher/target/release/mindex-watch "dist/$name/"
92-
cp LICENSE README.md "dist/$name/"
93-
cd dist
94-
tar -czf "$name.tar.gz" "$name"
95-
shasum -a 256 "$name.tar.gz" > "$name.tar.gz.sha256"
93+
mkdir -p "staging/$name" dist
94+
cp tools/indexer/target/release/mindex-index "staging/$name/"
95+
cp tools/watcher/target/release/mindex-watch "staging/$name/"
96+
cp LICENSE README.md "staging/$name/"
97+
tar -czf "dist/$name.tar.gz" -C staging "$name"
98+
(cd dist && shasum -a 256 "$name.tar.gz" > "$name.tar.gz.sha256")
9699
97100
- name: Package (windows)
98101
if: runner.os == 'Windows'
99102
shell: bash
100103
run: |
101104
set -euo pipefail
102105
name="mindex-cli-${{ matrix.target }}"
103-
mkdir -p "dist/$name"
104-
cp tools/indexer/target/release/mindex-index.exe "dist/$name/"
105-
cp tools/watcher/target/release/mindex-watch.exe "dist/$name/"
106-
cp LICENSE README.md "dist/$name/"
107-
cd dist
108-
7z a "$name.zip" "$name" > /dev/null
109-
certutil -hashfile "$name.zip" SHA256 > "$name.zip.sha256"
106+
mkdir -p "staging/$name" dist
107+
cp tools/indexer/target/release/mindex-index.exe "staging/$name/"
108+
cp tools/watcher/target/release/mindex-watch.exe "staging/$name/"
109+
cp LICENSE README.md "staging/$name/"
110+
(cd staging && 7z a "../dist/$name.zip" "$name" > /dev/null)
111+
(cd dist && sha256sum "$name.zip" > "$name.zip.sha256")
110112
111113
- name: Upload to the release
112114
shell: bash
113115
env:
114116
GH_TOKEN: ${{ github.token }}
115117
TAG: ${{ github.event.inputs.tag || github.ref_name }}
116-
run: gh release upload "$TAG" dist/*.tar.gz dist/*.zip dist/*.sha256 --clobber
118+
run: gh release upload "$TAG" dist/* --clobber
117119

118120
server:
119121
name: Server (linux x86-64)
@@ -147,19 +149,18 @@ jobs:
147149
run: |
148150
set -euo pipefail
149151
name="mindex-server-x86_64-unknown-linux-gnu"
150-
mkdir -p "dist/$name"
151-
cp target/release/mindex "dist/$name/"
152-
cp LICENSE README.md config.example.toml "dist/$name/"
153-
cd dist
154-
tar -czf "$name.tar.gz" "$name"
155-
shasum -a 256 "$name.tar.gz" > "$name.tar.gz.sha256"
152+
mkdir -p "staging/$name" dist
153+
cp target/release/mindex "staging/$name/"
154+
cp LICENSE README.md config.example.toml "staging/$name/"
155+
tar -czf "dist/$name.tar.gz" -C staging "$name"
156+
(cd dist && shasum -a 256 "$name.tar.gz" > "$name.tar.gz.sha256")
156157
157158
- name: Upload to the release
158159
shell: bash
159160
env:
160161
GH_TOKEN: ${{ github.token }}
161162
TAG: ${{ github.event.inputs.tag || github.ref_name }}
162-
run: gh release upload "$TAG" dist/*.tar.gz dist/*.sha256 --clobber
163+
run: gh release upload "$TAG" dist/* --clobber
163164

164165
vsix:
165166
name: VS Code extension

0 commit comments

Comments
 (0)