Skip to content

Commit

Permalink
Add macOS builds to release artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveice10 authored and Steveice10 committed Nov 3, 2023
1 parent 0110f2f commit e466470
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions .github/workflows/upload-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ on:

jobs:
build-standalone:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.system.os }}
strategy:
matrix:
os: [windows-latest]
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-latest, arch: x64, output_file: 'aqt_x64', primary_artifact: 'aqt-macos', secondary_artifact: 'aqt-macos_x64'}
]
py: [3.9]
arch: [x86, x64]
defaults:
run:
shell: ${{ matrix.system.os == 'windows-latest' && 'pwsh' || 'bash' }} {0}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -27,51 +33,52 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.arch }}
architecture: ${{ matrix.system.arch }}
- name: Build standalone binary
run: |
python -m venv venv
venv/Scripts/activate.ps1
${{ 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.arch }}
deactivate
Remove-Item venv -Recurse -Force
shell: pwsh
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\aqt_x64.exe
asset_name: aqt.exe
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.primary_artifact }}
tag: ${{ github.ref }}
overwrite: true
if: matrix.arch=='x64' && startsWith(github.ref, 'refs/tags/v')
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\aqt_${{ matrix.arch }}.exe
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.secondary_artifact }}
tag: ${{ github.ref }}
overwrite: true
if: startsWith(github.ref, 'refs/tags/v')
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\aqt_x64.exe
asset_name: aqt.exe
if: matrix.arch=='x64' && startsWith(github.ref, 'refs/tags/v')
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\aqt_${{ matrix.arch }}.exe
if: startsWith(github.ref, 'refs/tags/v')
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.secondary_artifact }}
if: matrix.system.secondary_artifact!='' && startsWith(github.ref, 'refs/tags/v')

0 comments on commit e466470

Please sign in to comment.