-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (64 loc) · 2.07 KB
/
build.yml
File metadata and controls
78 lines (64 loc) · 2.07 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
name: Build
on:
push:
tags: ['v*']
workflow_dispatch:
env:
DM40_PYTHON: python
CI: true
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: .github/workflows/CI-requirements.txt
- name: Install Nuitka
run: pip install -r .github/workflows/CI-requirements.txt
- name: Get Nuitka version
id: nuitka-ver
run: |
$ver = python -c "import nuitka.Version; print(nuitka.Version.getNuitkaVersion())"
echo "version=$ver" >> $env:GITHUB_OUTPUT
- name: Cache Nuitka tools
uses: actions/cache@v5
with:
path: ~\AppData\Local\Nuitka\Nuitka\Cache
key: nuitka-tools-${{ runner.os }}-${{ steps.nuitka-ver.outputs.version }}
restore-keys: nuitka-tools-${{ runner.os }}-
- name: Stamp version
id: version
env:
GH_REF: ${{ github.ref }}
GH_REF_NAME: ${{ github.ref_name }}
GH_SHA: ${{ github.sha }}
run: |
if ($env:GH_REF.StartsWith("refs/tags/v")) {
$ver = $env:GH_REF_NAME.TrimStart("v")
} else {
$ver = $env:GH_SHA.Substring(0, 7)
}
echo "ver=$ver" >> $env:GITHUB_OUTPUT
Set-Content -Path dm40/__version__.py -Value "__version__ = `"$ver`"`n"
- name: Build
run: cmd /c build_release.cmd
- name: Rename exe
run: |
$src = "build\ci\nuitka\DM40GUI.exe"
$dst = "build\ci\nuitka\DM40GUI-${{ steps.version.outputs.ver }}.exe"
Move-Item $src $dst
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
path: build\ci\nuitka\DM40GUI-${{ steps.version.outputs.ver }}.exe
archive: false
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3
with:
files: build\ci\nuitka\DM40GUI-*.exe