Initial commit: WinUI 3 confessional library app with CI/CD
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
name: CI Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: '8.0.x'
|
||||
NODE_VERSION: '20.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build (${{ matrix.configuration }})
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configuration: [Debug, Release]
|
||||
platform: [x64]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore Confessio/Confessio.csproj
|
||||
working-directory: ${{ github.workspace }}
|
||||
|
||||
- name: Build
|
||||
run: dotnet build Confessio/Confessio.csproj -c ${{ matrix.configuration }} -p:Platform=${{ matrix.platform }}
|
||||
working-directory: ${{ github.workspace }}
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Confessio-${{ matrix.configuration }}-${{ matrix.platform }}
|
||||
path: |
|
||||
Confessio/Confessio/bin/${{ matrix.platform }}/${{ matrix.configuration }}/net8.0-windows10.0.19041.0/win-${{ matrix.platform }}/Confessio.exe
|
||||
Confessio/Confessio/bin/${{ matrix.platform }}/${{ matrix.configuration }}/net8.0-windows10.0.19041.0/win-${{ matrix.platform }}/*.dll
|
||||
if-no-files-found: ignore
|
||||
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore Confessio/Confessio.csproj
|
||||
|
||||
- name: Run .NET analyzer
|
||||
run: dotnet build Confessio/Confessio.csproj -c Release --no-restore
|
||||
continue-on-error: true
|
||||
@@ -0,0 +1,85 @@
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: '8.0.x'
|
||||
|
||||
jobs:
|
||||
build-release:
|
||||
name: Build Release
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
# Build self-contained EXE (x64)
|
||||
- name: Publish self-contained (x64)
|
||||
run: |
|
||||
dotnet publish Confessio/Confessio.csproj -c Release -r win-x64 --self-contained true -o ./publish/win-x64
|
||||
working-directory: ${{ github.workspace }}
|
||||
|
||||
# Build self-contained EXE (ARM64)
|
||||
- name: Publish self-contained (ARM64)
|
||||
run: |
|
||||
dotnet publish Confessio/Confessio.csproj -c Release -r win-arm64 --self-contained true -o ./publish/win-arm64
|
||||
working-directory: ${{ github.workspace }}
|
||||
|
||||
# Create ZIP archives
|
||||
- name: Create ZIP archives
|
||||
run: |
|
||||
Compress-Archive -Path ./publish/win-x64/* -DestinationPath ./Confessio-win-x64.zip
|
||||
Compress-Archive -Path ./publish/win-arm64/* -DestinationPath ./Confessio-win-arm64.zip
|
||||
working-directory: ${{ github.workspace }}
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-artifacts
|
||||
path: |
|
||||
./Confessio-win-x64.zip
|
||||
./Confessio-win-arm64.zip
|
||||
retention-days: 30
|
||||
|
||||
create-release:
|
||||
name: Create GitHub Release
|
||||
needs: build-release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-artifacts
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
TAG=${{ github.ref_name }}
|
||||
VERSION=${TAG#v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "tag_date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
Confessio-win-x64.zip
|
||||
Confessio-win-arm64.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user