Build #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
jobs: | |
build_app: | |
runs-on: windows-latest # For a list of available runner types, refer to | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
env: | |
Solution_Name: ClassIsland.sln # Replace with your solution name, i.e. MyWpfApp.sln. | |
# Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. | |
Wap_Project_Directory: ClassIsland/ClassIsland # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. | |
Wap_Project_Path: ClassIsland/ClassIsland/ClassIsland.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. | |
strategy: | |
matrix: | |
trim_assets: [true, false] | |
name: Build (AssetsTrimmed ${{ matrix.trim_assets }}) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: List files | |
run: ls | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Build application | |
env: | |
trim_assets: ${{ matrix.trim_assets }} | |
run: | | |
ls | |
pwsh -ep Bypass -c ./tools/publish.ps1 $env:trim_assets | |
- name: Upload APP to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: out_app_assetsTrimmed_${{ matrix.trim_assets }} | |
path: ./out/*.zip | |
build_nupkg: | |
runs-on: windows-latest # For a list of available runner types, refer to | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
env: | |
Solution_Name: ClassIsland.sln # Replace with your solution name, i.e. MyWpfApp.sln. | |
# Test_Project_Path: your-test-project-path # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. | |
Wap_Project_Directory: ClassIsland/ClassIsland # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. | |
Wap_Project_Path: ClassIsland/ClassIsland/ClassIsland.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. | |
name: Build Nuget Packages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: List files | |
run: ls | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Build Nuget packages | |
env: | |
is_release: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
ls | |
pwsh -ep Bypass -c ./tools/publish-nupkg.ps1 $env:is_release | |
- name: Upload Nuget packages to GitHub registry | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
GHPKG_KEY: ${{ secrets.GHPKG_KEY }} | |
run: | | |
dotnet nuget add source --username HelloWRC --password $env:GHPKG_KEY --store-password-in-clear-text --name github "https://nuget.pkg.github.com/ClassIsland/index.json" | |
dotnet nuget push .\out\*.nupkg -k $env:GHPKG_KEY --source "github" --skip-duplicate | |
- name: Upload Nuget Packages to artifacts | |
if: ${{ !matrix.trim_assets }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: out_nupkgs | |
path: ./out/*.nupkg | |
publish: | |
runs-on: windows-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
needs: [build_app, build_nupkg] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./out_artifacts | |
- name: Pre publish | |
run: | | |
pwsh -ep Bypass -c ./tools/pre-publish.ps1 | |
# - name: Sentry Release | |
# uses: getsentry/[email protected] | |
# env: | |
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
# SENTRY_ORG: classisland | |
# SENTRY_PROJECT: classisland | |
# SENTRY_URL: ${{ vars.SENTRY_URL }} | |
# with: | |
# environment: production | |
- name: Upload APP to release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ./out/ClassIsland.zip,./out/*.zip | |
draft: true | |
bodyFile: ./out/checksums.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Nuget packages to NuGet Gallery | |
if: ${{ github.event_name != 'pull_request' }} | |
env: | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
run: | | |
ls | |
cd out | |
dotnet nuget push *.nupkg -k $env:NUGET_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate | |
- name: Upload to AppCenter | |
env: | |
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }} | |
run: | | |
$env:app_ver = (git describe --abbrev=0 --tags) | |
Write-Host "Uploading to AppCenter..." -ForegroundColor Cyan | |
pwsh -ep Bypass -c .\tools\pre-appcenter-upload.ps1 | |
pwsh -ep Bypass -c .\tools\appcenter-upload.ps1 $env:APPCENTER_TOKEN $env:app_ver | |