Skip to content

Commit d44ebd4

Browse files
authored
Merge pull request #78 from DataKitchen/exe-pipeline
ci: Building and releasing the Windows executable within the pipeline
2 parents 5cb87af + 0bfb9ab commit d44ebd4

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Windows Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
windows-release:
9+
uses: ./.github/workflows/python-job.yml
10+
secrets: inherit
11+
with:
12+
runner: windows-latest
13+
python-version: "3.9"
14+
run: |
15+
pyinstaller --onefile --exclude demo dk-installer.py
16+
export RELEASE_TAG=latest
17+
gh release delete "${RELEASE_TAG}" -y || true
18+
git push origin --delete "${RELEASE_TAG}" || true
19+
git tag "${RELEASE_TAG}"
20+
git push origin "${RELEASE_TAG}"
21+
gh release create "${RELEASE_TAG}" ./dist/dk-installer.exe \
22+
--title "Latest Release"

0 commit comments

Comments
 (0)