release #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release.yml | |
run-name: release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' # Run on semver like tags | |
jobs: | |
create-release: | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
outputs: | |
release_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
draft: false | |
prerelease: false | |
release_name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
build: | |
# if: ${{ github.ref == 'refs/heads/main' }} | |
needs: create-release | |
strategy: | |
matrix: | |
os: [ macos-latest, ubuntu-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check-out repository | |
uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: uv sync --all-extras --dev | |
- name: Build Executable with Nuitka | |
uses: Nuitka/Nuitka-Action@main | |
with: | |
nuitka-version: main | |
script-name: napytau/main.py | |
- name: Determine Build Artifact | |
id: artifact-path | |
run: | | |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
echo "artifact=build/main.exe" >> $GITHUB_ENV | |
echo "filename=main.exe" >> $GITHUB_ENV | |
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
zip -r build/main.app.zip build/main.app | |
echo "artifact=build/main.app.zip" >> $GITHUB_ENV | |
echo "filename=main.app.zip" >> $GITHUB_ENV | |
else | |
echo "artifact=build/main.bin" >> $GITHUB_ENV | |
echo "filename=main.bin" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Upload Artifacts | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.release_url }} | |
asset_name: ${{ env.filename }} | |
asset_path: ${{ env.artifact }} | |
asset_content_type: application/octet-stream |