Skip to content

Commit da7ea5a

Browse files
committed
ci: Building and releasing the Windows executable within the pipeline
1 parent 5d93995 commit da7ea5a

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

.github/workflows/python-job.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
python-version:
77
type: string
88
default: "3.9"
9+
runner:
10+
type: string
11+
default: ubuntu-latest
912
run:
1013
required: true
1114
type: string
@@ -20,7 +23,10 @@ on:
2023

2124
jobs:
2225
run:
23-
runs-on: ubuntu-latest
26+
runs-on: ${{ inputs.runner }}
27+
defaults:
28+
run:
29+
shell: bash
2430
steps:
2531
- name: Checkout source code
2632
uses: actions/checkout@v4
@@ -41,6 +47,8 @@ jobs:
4147
- name: Run Command
4248
run: |
4349
${{ inputs.run }}
50+
env:
51+
GH_TOKEN: ${{ github.token }}
4452

4553
- name: Upload artifacts
4654
uses: actions/upload-artifact@v4
@@ -49,4 +57,3 @@ jobs:
4957
name: ${{ inputs.artifact }}
5058
path: ${{ inputs.artifact_path }}
5159
if-no-files-found: ignore
52-

.github/workflows/release_exe.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release Windows Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_name:
7+
description: "Release name"
8+
required: true
9+
default: "test"
10+
push:
11+
branches:
12+
- exe-pipeline
13+
14+
jobs:
15+
windows-release:
16+
uses: ./.github/workflows/python-job.yml
17+
secrets: inherit
18+
with:
19+
runner: windows-latest
20+
python-version: "3.9"
21+
run: |
22+
pyinstaller --exclude demo dk-installer.py
23+
gh release delete "${{ inputs.release_name }}" -y || true
24+
git push origin --delete "${{ inputs.release_name }}" || true
25+
git tag "${{ inputs.release_name }}"
26+
git push origin "${{ inputs.release_name }}"
27+
gh release create "${{ inputs.release_name }}" ./dist/dk-installer/dk-installer.exe \
28+
--title "Latest Release"

0 commit comments

Comments
 (0)