Skip to content

Build & Release

Build & Release #14

Workflow file for this run

name: Build & Release
on:
workflow_dispatch:
inputs:
version:
description: 'Tag / version (e.g. v1.2.3)'
required: true
type: string
permissions:
contents: write # needed to create releases
packages: read
jobs:
# ---------- BUILD ----------
build:
runs-on: ${{ matrix.os }}
env:
DOTNET_RESTORE_LOCKED_MODE: false
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
fw: net9.0-windows10.0.19041.0
art: win-x64
- os: macos-latest
rid: osx-arm64
fw: net9.0-macos
art: macos-arm64
steps:
# 1 ─ Checkout repositories
- name: Checkout AluaAchievements
uses: actions/checkout@v4
with:
repository: Rarisma/AluaAchievements
path: AluaAchievements
- name: Checkout SACHYA
uses: actions/checkout@v4
with:
repository: rarisma/sachya
path: SACHYA
# 2 ─ Install the .NET SDK
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.*.*'
# 3 ─ Optional workloads (Uno/Maui, etc.)
- name: Install .NET workloads
working-directory: ./AluaAchievements
run: dotnet workload restore
# 4 ─ Restore NuGet packages
- name: Restore dependencies
working-directory: ./AluaAchievements
run: dotnet restore Alua.sln
# 5 ─ Publish self-contained, single-file binaries
- name: Publish application
working-directory: ./AluaAchievements
run: >
dotnet publish Alua/Alua.csproj
-c Release
-f ${{ matrix.fw }}
-r ${{ matrix.rid }}
--self-contained
-p:PublishSingleFile=true
-o publish
--no-restore
# 6 ─ Zip the publish output
- name: Archive artifact
working-directory: ./AluaAchievements/publish
run: 7z a ../../${{ matrix.art }}.zip *
# 7 ─ Upload artifact for the release job
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.art }}
path: ${{ matrix.art }}.zip
# ---------- RELEASE ----------
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
artifacts: "dist/**/*.zip"
generateReleaseNotes: true