-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·92 lines (81 loc) · 2.42 KB
/
Copy pathbinary-release.yml
File metadata and controls
executable file
·92 lines (81 loc) · 2.42 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
name: Build binaries and create GitHub Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
ref:
description: "Tag or ref to build, for example v0.23.0"
required: true
type: string
env:
RELEASE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref_name }}
permissions:
contents: write
jobs:
build-binary:
name: Build binary (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: macos-arm64
os: macos-latest
artifact: sit-macos-arm64
- target: macos-x86_64
os: macos-15-intel
artifact: sit-macos-x86_64
- target: linux-x86_64
os: ubuntu-latest
artifact: sit-linux-x86_64
- target: windows-x86_64
os: windows-2025-vs2026
artifact: sit-windows-x86_64.exe
steps:
- uses: actions/checkout@v5
with:
ref: ${{ env.RELEASE_REF }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pyinstaller
- name: Build binary
run: python scripts/build_binary.py --name sit
- name: Rename binary
shell: bash
run: |
if [[ "${{ matrix.target }}" == windows-* ]]; then
mv dist/binary/sit.exe dist/binary/${{ matrix.artifact }}
else
mv dist/binary/sit dist/binary/${{ matrix.artifact }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact }}
path: dist/binary/${{ matrix.artifact }}
create-release:
name: Create GitHub Release
needs: build-binary
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: binaries
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "$RELEASE_REF" >/dev/null 2>&1; then
gh release upload "$RELEASE_REF" binaries/*/* --clobber
else
gh release create "$RELEASE_REF" binaries/*/* --generate-notes --title "$RELEASE_REF"
fi