forked from PiDanShouRouZhouXD/Sakura_Launcher_GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.32 KB
/
build.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
name: build
on:
workflow_dispatch: # allows manual triggering
inputs:
create_release:
description: "Create new release"
required: true
type: boolean
push:
branches:
- main
paths: [".github/workflows/build.yml", "main.spec", "**/*.py"]
pull_request:
types: [opened, synchronize, reopened]
paths: ["**/*.py"]
jobs:
windows-latest:
runs-on: windows-latest
steps:
- name: Clone
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python Environment
id: pyenv
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Build
id: pyinstaller_build
shell: powershell
run: |
pyinstaller --clean --noconfirm main.spec
Rename-Item -Path "dist\main.exe" -NewName "Sakura_Launcher_GUI_$('${{ github.sha }}'.Substring(0,7)).exe"
- name: Upload artifacts
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.event.inputs.create_release == 'true' }}
uses: actions/upload-artifact@v4
with:
path: |
dist