-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (108 loc) · 3.08 KB
/
ci.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: ci
on:
push:
branches:
- main
tags:
- '*'
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: |
pyproject.toml
- name: Install
run: |
pip install .[test]
- name: Linter
run: |
make lint
# `import pyglet` crashes on ubuntu-latest due to missing X window system
if: matrix.os == 'macos-latest'
- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: imshow
onefile: true
- name: Test Executable
run: |
./build/imshow.bin --version
# `import pyglet` crashes on ubuntu-latest due to missing X window system
if: matrix.os == 'macos-latest'
- name: Rename Executable
run: |
mv build/imshow.bin build/imshow-${{ runner.os }}.bin
if: matrix.os != 'windows-latest'
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ runner.os }}
path: |
build/*.exe
build/*.bin
release:
needs: build
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configurationJson: |
{
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>\n",
"pr_template": "- #{{TITLE}} ##{{NUMBER}}",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature"]
},
{
"title": "## ✨ Enhancement",
"labels": ["enhancement"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix"]
},
{
"title": "## 💬 Other",
"labels": ["other"]
}
]
}
- name: Create Changelog
run: |
echo ${{steps.github_release.outputs.changelog}} > ${{ github.workspace }}-CHANGELOG.txt
- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: build
pattern: build-*
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: |
build/*