-
-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (62 loc) · 1.98 KB
/
build.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
name: Build
on:
pull_request:
push:
branches:
- main
release:
types: [created]
jobs:
test:
name: Python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
env:
RELEASE_FILE: ${{ github.event.repository.name }}-${{ github.event.release.tag_name || github.sha }}-py${{ matrix.python }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
path: rpipins
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
working-directory: rpipins
run: |
make dev-deps
- name: Build Packages
working-directory: rpipins
run: |
make build
- name: Upload Packages
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}
path: ${{ github.workspace }}/rpipins/dist/
- name: Build Debian Package
if: matrix.python == '3.11'
working-directory: rpipins
run: |
echo "DEB_VERSION=`hatchling version`" >> "$GITHUB_ENV"
make deb-deps
make deb
- name: Upload Debian Package
if: matrix.python == '3.11'
uses: actions/upload-artifact@v4
with:
name: rpipins_${{ env.DEB_VERSION }}_all.deb
path: ${{ github.workspace }}/rpipins_${{ env.DEB_VERSION }}_all.deb
- name: Upload Debian Package
if: github.event_name == 'release' && matrix.python == '3.11'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_path: ${{ github.workspace }}/rpipins_${{ env.DEB_VERSION }}_all.deb
upload_url: ${{ github.event.release.upload_url }}
asset_name: rpipins_${{ env.DEB_VERSION }}_all.deb
asset_content_type: application/octet-stream