-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (52 loc) · 1.93 KB
/
release.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
name: release
on:
release:
types: [published]
workflow_dispatch:
jobs:
deploy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: bitsrun
asset_name: bitsrun-x86_64-linux.bin
- os: windows-latest
artifact_name: bitsrun.exe
asset_name: bitsrun-x86_64-windows.exe
- os: macos-latest
artifact_name: bitsrun
asset_name: bitsrun-universal-macos.bin
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip" # caching pip dependencies
- name: Set up build tools
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pyinstaller
- name: Compile single executable for Windows/Linux
run: pyinstaller --onefile --noconfirm --clean --name=${{ matrix.artifact_name }} src/bitsrun/cli.py
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
- name: Compile single executable for macOS
run: pyinstaller --onefile --noconfirm --clean --name=${{ matrix.artifact_name }} --target-arch=universal2 src/bitsrun/cli.py
if: matrix.os == 'macos-latest'
# - name: Package binaries for Linux/macOS
# run: |
# cd dist
# tar -czvf ${{ matrix.asset_name }} ${{ matrix.artifact_name }}
# cd -
# if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
- name: Upload binaries to GitHub release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}