Skip to content

Commit 1ff2262

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

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.github/workflows/python-job.yml

Lines changed: 7 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
@@ -49,4 +55,3 @@ jobs:
4955
name: ${{ inputs.artifact }}
5056
path: ${{ inputs.artifact_path }}
5157
if-no-files-found: ignore
52-

.github/workflows/release_exe.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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: "latest"
10+
11+
jobs:
12+
windows-release:
13+
uses: ./.github/workflows/python-job.yml
14+
secrets: inherit
15+
with:
16+
runner: windows-latest
17+
python-version: "3.9"
18+
release_name: test
19+
run: |
20+
pyinstaller --exclude demo dk-installer.py
21+
ls -lR ./dist
22+
23+
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
24+
gh release delete "${{ github.event.inputs.release_name }}" -y || true
25+
gh release create "${{ github.event.inputs.release_name }}" ./dist/dk-installer/dk-installer.exe \
26+
--title "Latest Release"

0 commit comments

Comments
 (0)