forked from whywilson/pn532-python
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (86 loc) · 2.58 KB
/
pyinstaller.yml
File metadata and controls
100 lines (86 loc) · 2.58 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Client Build
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
release:
types: [created]
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: pn532_cli_release_linux
- os: windows-latest
artifact_name: pn532_cli_release_windows
- os: macos-latest
artifact_name: pn532_cli_release_macos
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r script/requirements.txt
pip install pyinstaller
- name: Run PyInstaller
run: |
pyinstaller script/pyinstaller.spec
- name: Package artifact (Linux)
if: runner.os == 'Linux'
run: |
zip -r "${{ matrix.artifact_name }}.zip" dist/*
- name: Package artifact (macOS)
if: runner.os == 'macOS'
run: |
zip -r "${{ matrix.artifact_name }}.zip" dist/*
- name: Package artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive -Path "dist/*" -DestinationPath "${{ matrix.artifact_name }}.zip"
- name: Upload artifacts (zip only)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}.zip
prerelease:
name: Create prerelease and attach builds
needs: build
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- name: Compute short SHA
id: vars
run: echo "short_sha=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
pattern: '*'
merge-multiple: true
path: release-assets
- name: Create GitHub prerelease and upload assets
uses: softprops/action-gh-release@v2
with:
tag_name: beta.${{ steps.vars.outputs.short_sha }}
name: PN532 CLI - beta.${{ steps.vars.outputs.short_sha }}
prerelease: true
draft: false
body: |
Auto-generated beta prerelease for commit ${{ github.sha }}.
This release contains PyInstaller builds for Linux, Windows, and macOS.
files: |
release-assets/*.zip