-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (78 loc) · 2.71 KB
/
Python-Build.yml
File metadata and controls
91 lines (78 loc) · 2.71 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Python Build Release
on:
workflow_dispatch:
inputs:
release_tag:
description: '版本发布标签'
required: true
type: string
version:
description: '版本名称'
required: true
type: string
release_channel:
description: '版本发布通道'
required: true
type: choice
options: [Stable, Preview, Beta, Dev]
default: 'Stable'
env:
artifact_name: WindowsLoginHelper_${{ github.event.inputs.release_tag }}_${{ github.event.inputs.release_channel }}
jobs:
Build-Release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up 32-bit Python
uses: actions/setup-python@v5.3.0
with:
python-version: '3.8.10'
architecture: 'x86'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Build EXE
shell: bash {0}
run: |
./nuitka-build.sh "${{ github.event.inputs.release_tag }}"
- name: Upload EXE to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: dist/Windows-Login-Helper/
- name: Install Inno Setup
run: |
choco install innosetup
echo 'Installed Inno Setup successfully.'
- name: Create Installer
run: |
ISCC.exe Installer/WindowsLoginHelper.iss
mkdir -p ./release
mv -Path "Installer/WindowsLoginHelper_Setup.exe" -Destination "release/${{ env.artifact_name }}_Setup.exe" -Force
- name: Upload Installer to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}_Installer
path: release/${{ env.artifact_name }}_Setup.exe
- name: Calculate checksums
run: |
ls release -Recurse -Force
pwsh .github/workflows/generate-sha256.ps1 release/
- name: Create Release
if: ${{ github.event.inputs.release_channel != 'Dev' }}
uses: ncipollo/release-action@v1
env:
IS_PRERELEASE: ${{ github.event.inputs.release_channel == 'Preview' || github.event.inputs.release_channel == 'Beta' }}
with:
artifacts: release/*.exe
draft: true
bodyFile: release/checksums.md
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event_name != 'workflow_dispatch' && github.ref || github.event.inputs.release_tag }}
name: ${{ github.event.inputs.version }}-${{ github.event.inputs.release_channel }}
prerelease: ${{ env.IS_PRERELEASE }}
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true