Repository navigation
75 lines (63 loc) · 1.93 KB
/
Copy pathrelease.yml
File metadata and controls
75 lines (63 loc) · 1.93 KB
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
name: Release Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
py: '3.11'
asset_name: 'GTPB-win64'
compress_ext: 'zip'
exe_name: 'GTPB.exe'
- os: ubuntu-latest
py: '3.11'
asset_name: 'GTPB-linux-x64'
compress_ext: 'tar.gz'
exe_name: 'GTPB'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt
- name: Build with PyInstaller
run: |
python -m PyInstaller --noconfirm --clean gtpb.spec
- name: Inspect dist
shell: bash
run: |
ls -la dist/
ls -la dist/*
- name: Package artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive -Path "dist\GTPB.exe" -DestinationPath "${{ matrix.asset_name }}.${{ matrix.compress_ext }}"
Get-Item "${{ matrix.asset_name }}.${{ matrix.compress_ext }}" | Select-Object Name, Length
- name: Package artifact (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
mkdir -p package
cp dist/GTPB package/GTPB
tar -czf "${{ matrix.asset_name }}.${{ matrix.compress_ext }}" -C package GTPB
ls -la "${{ matrix.asset_name }}.${{ matrix.compress_ext }}"
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.asset_name }}.${{ matrix.compress_ext }}
generate_release_notes: false