Skip to content

Commit f997efb

Browse files
committed
archive zip or tar
1 parent 437ec00 commit f997efb

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,30 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: Setup vars
1919
id: setup-vars
20-
run: grep "python" "mise.toml" | perl -pe 's/[ "]+//g' >> $GITHUB_OUTPUT
20+
run: |
21+
grep "python" "mise.toml" | perl -pe 's/[ "]+//g' >> $GITHUB_OUTPUT
22+
- name: Set filename
23+
uses: actions/github-script@v7
24+
id: set-filename
25+
with:
26+
script: |
27+
const os = require("os");
28+
const platform = process.platform
29+
const arch = process.env.PROCESSOR_ARCHITEW6432 || process.arch;
30+
if (platform === "win32") {
31+
return `fontsplitta-${platform}-${arch}.zip`;
32+
} else {
33+
return `fontsplitta-${platform}-${arch}.tar.gz`;
34+
}
35+
result-encoding: string
36+
- name: Set type
37+
id: set-type
38+
run: |
39+
if [[ "${ matrix.os }" == "windows-latest" ]]; then
40+
echo "result=zip" >> $GITHUB_OUTPUT
41+
else
42+
echo "result=tar" >> $GITHUB_OUTPUT
43+
fi
2144
- name: Setup Python
2245
uses: actions/setup-python@v2
2346
with:
@@ -30,11 +53,16 @@ jobs:
3053
- name: Build executable
3154
run: |
3255
poetry run pyinstaller --onefile --clean --name "fontsplitta" "fontsplitta/__main__.py"
56+
- name: Archive Release
57+
uses: thedoctor0/zip-release
58+
with:
59+
directory: "dist"
60+
type: ${{ steps.set-type.outputs.result }}
61+
filename: ${{ steps.set-filename.outputs.result }}
3362
- name: Release
3463
uses: softprops/action-gh-release@v2
3564
with:
36-
files: |
37-
dist/fontsplitta
65+
files: ${{ steps.set-filename.outputs.result }}
3866
release-python:
3967
runs-on: ubuntu-latest
4068
env:

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cSpell.words": [
3+
"ARCHITEW",
34
"Fontsplitta",
45
"fonttools",
56
"KHTML",
@@ -10,6 +11,7 @@
1011
"setuptools",
1112
"shunirr",
1213
"softprops",
14+
"thedoctor",
1315
"unicodes",
1416
"urllib"
1517
]

0 commit comments

Comments
 (0)