Skip to content

Commit 95ac706

Browse files
Modify release workflow for binary naming and packaging
Updated the release workflow to include binary names for different OS platforms and adjusted packaging steps accordingly.
1 parent e8d0162 commit 95ac706

1 file changed

Lines changed: 48 additions & 18 deletions

File tree

β€Ž.github/workflows/release-binaries.ymlβ€Ž

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ jobs:
6464
include:
6565
- os: ubuntu-latest
6666
name: linux
67+
binary: bangen
6768
- os: windows-latest
6869
name: windows
70+
binary: bangen.exe
6971
- os: macos-latest
7072
name: macos
73+
binary: bangen
7174

7275
steps:
7376
- uses: actions/checkout@v4
@@ -99,8 +102,10 @@ jobs:
99102
printf 'from bangen.app import main\nif __name__ == "__main__":\n main()\n' > _entry.py
100103
python -m PyInstaller \
101104
--onefile \
105+
--noconfirm \
102106
--name bangen \
103-
--distpath build \
107+
--distpath dist \
108+
--workpath build \
104109
--collect-all bangen \
105110
--collect-all pyfiglet \
106111
--collect-all rich \
@@ -124,22 +129,23 @@ jobs:
124129
shell: bash
125130
env:
126131
VERSION: ${{ needs.tag.outputs.version }}
132+
BINARY: ${{ matrix.binary }}
127133
run: |
128-
mkdir -p dist
134+
mkdir -p release
129135
NAME="bangen-${{ matrix.name }}-$VERSION"
130136
if [[ "$RUNNER_OS" == "Windows" ]]; then
131-
mv build/bangen.exe dist/"$NAME.exe"
132-
powershell -Command "Compress-Archive -Path dist\\$NAME.exe -DestinationPath dist\\$NAME.zip"
133-
rm dist/"$NAME.exe"
137+
mv "dist/$BINARY" "release/$NAME.exe"
138+
powershell -Command "Compress-Archive -Path release\\$NAME.exe -DestinationPath release\\$NAME.zip"
139+
rm "release/$NAME.exe"
134140
else
135-
mv build/bangen dist/"$NAME"
136-
(cd dist && tar -czf "$NAME.tar.gz" "$NAME" && rm "$NAME")
141+
mv "dist/$BINARY" "release/$NAME"
142+
(cd release && tar -czf "$NAME.tar.gz" "$NAME" && rm "$NAME")
137143
fi
138144
139145
- uses: actions/upload-artifact@v4
140146
with:
141147
name: ${{ matrix.name }}-build
142-
path: dist/*
148+
path: release/*
143149
retention-days: 1
144150

145151
release:
@@ -180,10 +186,14 @@ jobs:
180186
SINCE_LINE="> Initial release"
181187
fi
182188
183-
FEATS=$(echo "$COMMITS" | grep -E "^- feat" | sed 's/^- feat[^:]*: /- /' || true)
184-
FIXES=$(echo "$COMMITS" | grep -E "^- fix" | sed 's/^- fix[^:]*: /- /' || true)
185-
CHORES=$(echo "$COMMITS" | grep -E "^- (chore|refactor|perf|build|ci)" | sed 's/^- [^:]*: /- /' || true)
186-
OTHER=$(echo "$COMMITS" | grep -vE "^- (feat|fix|chore|refactor|perf|build|ci)" || true)
189+
FEATS=$(echo "$COMMITS" | grep -E "^- feat" | sed 's/^- feat[^:]*: /- /' || true)
190+
FIXES=$(echo "$COMMITS" | grep -E "^- fix" | sed 's/^- fix[^:]*: /- /' || true)
191+
CHORES=$(echo "$COMMITS" | grep -E "^- (chore|refactor|perf|build|ci)" | sed 's/^- [^:]*: /- /' || true)
192+
OTHER=$(echo "$COMMITS" | grep -vE "^- (feat|fix|chore|refactor|perf|build|ci)" || true)
193+
194+
LINUX_SHA=$(grep "bangen-linux-$VERSION.tar.gz" artifacts/SHA256SUMS.txt | awk '{print $1}' || true)
195+
WINDOWS_SHA=$(grep "bangen-windows-$VERSION.zip" artifacts/SHA256SUMS.txt | awk '{print $1}' || true)
196+
MACOS_SHA=$(grep "bangen-macos-$VERSION.tar.gz" artifacts/SHA256SUMS.txt | awk '{print $1}' || true)
187197
188198
{
189199
echo "body<<NOTES_EOF"
@@ -217,13 +227,33 @@ jobs:
217227
echo ""
218228
echo "## πŸ“¦ Downloads"
219229
echo ""
220-
echo "| Platform | File |"
221-
echo "|----------|------|"
222-
echo "| 🐧 Linux | \`bangen-linux-$VERSION.tar.gz\` |"
223-
echo "| πŸͺŸ Windows | \`bangen-windows-$VERSION.zip\` |"
224-
echo "| 🍎 macOS | \`bangen-macos-$VERSION.tar.gz\` |"
230+
echo "Pre-built native binaries are available for all major platforms β€” no Python installation required."
231+
echo ""
232+
echo "| Platform | Architecture | File | SHA-256 |"
233+
echo "|----------|-------------|------|---------|"
234+
echo "| 🐧 Linux | x86_64 | \`bangen-linux-$VERSION.tar.gz\` | \`$LINUX_SHA\` |"
235+
echo "| πŸͺŸ Windows | x86_64 | \`bangen-windows-$VERSION.zip\` | \`$WINDOWS_SHA\` |"
236+
echo "| 🍎 macOS | arm64 | \`bangen-macos-$VERSION.tar.gz\` | \`$MACOS_SHA\` |"
237+
echo ""
238+
echo "### πŸš€ Quick Install"
239+
echo ""
240+
echo "\`\`\`bash"
241+
echo "# Linux / macOS"
242+
echo "tar -xzf bangen-<platform>-$VERSION.tar.gz"
243+
echo "chmod +x bangen-<platform>-$VERSION"
244+
echo "sudo mv bangen-<platform>-$VERSION /usr/local/bin/bangen"
245+
echo ""
246+
echo "# Windows (PowerShell)"
247+
echo "Expand-Archive bangen-windows-$VERSION.zip ."
248+
echo "\`\`\`"
249+
echo ""
250+
echo "### πŸ”’ Verify Your Download"
251+
echo ""
252+
echo "\`\`\`bash"
253+
echo "sha256sum -c SHA256SUMS.txt"
254+
echo "\`\`\`"
225255
echo ""
226-
echo "> πŸ”’ Verify downloads with \`SHA256SUMS.txt\`"
256+
echo "> Full checksums for all artifacts are in \`SHA256SUMS.txt\`, included in the release assets below."
227257
echo "NOTES_EOF"
228258
} >> "$GITHUB_OUTPUT"
229259

0 commit comments

Comments
Β (0)