-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.88 KB
/
script-release.yml
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
name: Release Python app
run-name: Release ${{ github.ref_name }}
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build app for ${{ matrix.os }}
runs-on: ${{ matrix.runner_os }}
strategy:
matrix:
runner_os: ["windows-latest", "macos-latest", "ubuntu-latest"]
include:
- runner_os: "windows-latest"
os: "Windows"
- runner_os: "macos-latest"
os: "Mac"
- runner_os: "ubuntu-latest"
os: "Linux"
steps:
- name: Checkout ref
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install requirements
run: |
pip install -r requirements.txt
pip install https://github.com/pyinstaller/pyinstaller/archive/7ebb7014a47f635a2475e4047714f45578f03dec.zip
- name: PyInstaller
run: pyinstaller --onefile --windowed script.py --name CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}
- name: List dist directory
run: ls -R dist
- name: Tar files on Linux
if: ${{ matrix.runner_os == 'ubuntu-latest' }}
run: |
chmod +x dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}
tar -czvf dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}.tar.gz dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}
rm -rf dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}
- name: Zip folder on Mac
if: ${{ matrix.runner_os == 'macos-latest' }}
run: |
zip -r CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}.zip dist/
rm -rf dist/
mkdir dist/
mv CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}.zip dist/
- name: Upload debug builds
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_builds
path: build/*
- name: Upload distributable builds
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_dists
path: dist/*
normal_release:
name: Draft normal release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
pattern: "*_dists"
- name: List release-artifacts directory # debug
run: ls -R release-artifacts
- name: Draft normal release
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
tag: ${{ github.ref_name }}
artifacts: release-artifacts/*_dists/*
draft: true
name: "CatPack Crafter ${{ github.ref_name }}"
body: "Need help? Refer to the documentation site."