-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (77 loc) · 2.09 KB
/
Copy pathci.yml
File metadata and controls
81 lines (77 loc) · 2.09 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
79
80
81
name: CI
on:
push:
tags:
- "v*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Lint
run: ruff check .
- name: Test
run: pytest
build-binaries:
name: Build binary (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e . pyinstaller
- name: Build executable
shell: bash
run: |
pyinstaller --clean --noconfirm --onefile --name hawkbit --paths src scripts/pyinstaller_entrypoint.py
- name: Collect Linux artifact
if: runner.os == 'Linux'
shell: bash
run: |
mkdir -p release
cp dist/hawkbit release/hawkbit-linux-x86_64
- name: Collect Windows artifact
if: runner.os == 'Windows'
shell: bash
run: |
mkdir -p release
cp dist/hawkbit.exe release/hawkbit-windows-x86_64.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: hawkbit-${{ runner.os }}-binary
path: release/*
release:
name: Publish release assets
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [build-binaries]
permissions:
contents: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
release-assets/**/hawkbit-linux-x86_64
release-assets/**/hawkbit-windows-x86_64.exe