-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (64 loc) · 2 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
62
63
64
65
66
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: Install Python
run: uv python install 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
mode: app
- name: Determine Build Artifact
id: artifact-path
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
echo "artifact=build/main.exe" >> $GITHUB_ENV
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
echo "artifact=build/main.app" >> $GITHUB_ENV
else
echo "artifact=build/main.bin" >> $GITHUB_ENV
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: ${{ runner.os }} Build
asset_path: ${{ env.artifact }}
asset_content_type: application/octet-stream