Files
highminded/.github/workflows/release.yml
2025-07-05 17:22:08 +05:30

88 lines
2.0 KiB
YAML

name: build highminded
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0)'
required: true
default: 'v1.0.0'
prerelease:
description: 'Mark as pre-release'
type: boolean
required: false
default: false
jobs:
build:
strategy:
matrix:
os: [windows-latest, macos-latest]
include:
- os: windows-latest
runtime: win-x64
artifact-name: windows-x64
- os: macos-latest
runtime: osx-arm64
artifact-name: macos-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Publish
if: github.event_name == 'release'
run: |
dotnet publish \
--configuration Release \
--runtime ${{ matrix.runtime }} \
--self-contained true \
--output ./publish/${{ matrix.artifact-name }}
- name: Upload build artifacts
if: github.event_name == 'release'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ./publish/${{ matrix.artifact-name }}
create-release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create release archives
run: |
cd ./artifacts
for dir in */; do
zip -r "${dir%/}.zip" "$dir"
done
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}