-
-
Notifications
You must be signed in to change notification settings - Fork 87
84 lines (80 loc) · 3.54 KB
/
upload-release-artifacts.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
74
75
76
77
78
79
80
81
82
83
84
# This will only run automatically when releases have been created,
# and will only upload binaries to previously-created releases.
# When run manually, it will overwrite the previous reelease binary
name: Upload release artifacts
on:
release:
types:
- created
workflow_dispatch:
jobs:
build-standalone:
runs-on: ${{ matrix.system.os }}
strategy:
matrix:
system: [
{os: windows-latest, arch: x86, output_file: 'aqt_x86.exe', primary_artifact: '', secondary_artifact: 'aqt_x86.exe'},
{os: windows-latest, arch: x64, output_file: 'aqt_x64.exe', primary_artifact: 'aqt.exe', secondary_artifact: 'aqt_x64.exe'},
{os: macOS-13, arch: x64, output_file: 'aqt_x64', primary_artifact: 'aqt-macos', secondary_artifact: 'aqt-macos_x64'}
]
py: [3.12]
defaults:
run:
shell: ${{ matrix.system.os == 'windows-latest' && 'pwsh' || 'bash' }} {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 20
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.system.arch }}
- name: Build standalone binary
run: |
python -m venv venv
${{ matrix.system.os == 'windows-latest' && 'venv/Scripts/activate.ps1' || 'chmod +x venv/bin/activate && venv/bin/activate' }}
python -m pip install -U pip wheel setuptools setuptools_scm pyinstaller
python -m pip install .
python tools/build_standalone.py ${{ matrix.system.arch }}
${{ matrix.system.os == 'windows-latest' && 'deactivate' || 'chmod +x venv/bin/deactivate && venv/bin/deactivate' }}
${{ matrix.system.os == 'windows-latest' && 'Remove-Item venv -Recurse -Force' || 'rm -rf venv' }}
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.primary_artifact }}
tag: ${{ github.ref }}
overwrite: true
if: matrix.system.primary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
- name: Upload to Release for all architectures
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.secondary_artifact }}
tag: ${{ github.ref }}
overwrite: true
if: matrix.system.secondary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
- name: Update continuous build
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
prerelease: true
tag: Continuous
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.primary_artifact }}
if: matrix.system.primary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
- name: Update continuous build for all architectures
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
prerelease: true
tag: Continuous
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.secondary_artifact }}
if: matrix.system.secondary_artifact!='' && startsWith(github.ref, 'refs/tags/v')