-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (81 loc) · 2.59 KB
/
publish-release.yaml
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
name: publish-release
on:
push:
branches:
- main
jobs:
build-windows:
runs-on: windows-latest
outputs:
version: ${{ steps.create_tag.outputs.version }}
strategy:
matrix:
python-version: ['3.11']
steps:
- name: checkout
uses: actions/checkout@v3
- name: install python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install uv
- name: build
run: |
uv add --dev nuitka
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv.exe --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py
- name: verify
run: |
dist/qsv.exe -h
- name: create tag
id: create_tag
if: startsWith(github.ref, 'refs/heads/main')
run: |
version=$(cat pyproject.toml | grep version | head -1 | awk -F '"' '{print $2}')
git tag "v$version"
git push origin "v$version"
echo "version=v$version" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.create_tag.outputs.version }}
files: dist/qsv.exe
name: Release ${{ steps.create_tag.outputs.version }}
body: 'This release was automatically created by GitHub Actions.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux:
needs: build-windows
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.11']
steps:
- name: checkout
uses: actions/checkout@v3
- name: install python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install patchelf
pip install uv
- name: build
run: |
uv add --dev nuitka
uv run python -m nuitka --standalone --onefile --follow-imports -o qsv --output-dir=dist --assume-yes-for-downloads src/qsv/__init__.py
- name: verify
run: |
dist/qsv -h
- name: upload asset to release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.build-windows.outputs.version }}
files: dist/qsv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}