mirror of
https://github.com/Heretek-AI/not-zune.git
synced 2026-10-12 02:04:04 +00:00
83 lines
2.2 KiB
YAML
83 lines
2.2 KiB
YAML
name: Build & Release Not-Zune
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
tags: [ 'v*' ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: Build (${{ matrix.name }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
rid: linux-x64
|
|
name: Linux-x64
|
|
archive: tar.gz
|
|
- os: ubuntu-latest
|
|
rid: linux-arm64
|
|
name: Linux-arm64
|
|
archive: tar.gz
|
|
- os: windows-latest
|
|
rid: win-x64
|
|
name: Windows-x64
|
|
archive: zip
|
|
- os: windows-latest
|
|
rid: win-arm64
|
|
name: Windows-arm64
|
|
archive: zip
|
|
|
|
steps:
|
|
- name: Checkout Source
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET 8.0 SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Run Unit Tests
|
|
run: dotnet test NotZune.sln -c Release --verbosity normal
|
|
|
|
- name: Publish Standalone Desktop Application
|
|
run: >
|
|
dotnet publish src/NotZune.Desktop/NotZune.Desktop.csproj
|
|
-c Release
|
|
-r ${{ matrix.rid }}
|
|
--self-contained true
|
|
-o publish/${{ matrix.rid }}
|
|
|
|
- name: Package Distribution Archive (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
tar -czvf NotZune-${{ matrix.name }}.tar.gz -C publish/${{ matrix.rid }} .
|
|
|
|
- name: Package Distribution Archive (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
Compress-Archive -Path publish\${{ matrix.rid }}\* -DestinationPath NotZune-${{ matrix.name }}.zip
|
|
|
|
- name: Upload CI Build Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: NotZune-${{ matrix.name }}
|
|
path: NotZune-${{ matrix.name }}.${{ matrix.archive }}
|
|
retention-days: 14
|
|
|
|
- name: Upload Release Asset
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: NotZune-${{ matrix.name }}.${{ matrix.archive }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|