CI #30
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: CI | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Restore packages | |
run: dotnet.exe restore .\src\UserRights.sln | |
- name: Run tests | |
run: dotnet.exe test .\src\UserRights.sln | |
- name: Clean solution | |
run: dotnet.exe clean .\src\UserRights.sln --configuration Release | |
- name: Publish runtime-dependent release | |
run: dotnet.exe publish .\src\UserRights\UserRights.csproj --configuration Release --runtime win-x64 --no-self-contained --output .\publish | |
- name: Archive runtime-dependent release | |
run: | | |
cd ./publish | |
Get-ChildItem . -Exclude *.pdb,*.xml -Recurse |Compress-Archive -DestinationPath ../UserRights-net80-x64.zip | |
- name: Upload runtime-dependent release | |
uses: actions/upload-artifact@v3 | |
with: | |
name: UserRights-net80-x64 | |
path: publish | |
if-no-files-found: error | |
- name: Clean solution | |
run: dotnet.exe clean .\src\UserRights.sln --configuration Release | |
- name: Publish self-contained release | |
run: dotnet.exe publish .\src\UserRights\UserRights.csproj --configuration Release --runtime win-x64 --self-contained --output .\publish-packed -p:PublishSingleFile=true -p:PublishReadyToRun=true | |
- name: Archive self-contained release | |
run: | | |
cd ./publish-packed | |
Compress-Archive -Path ./UserRights.exe -DestinationPath ../UserRights-net80-x64-self-contained.zip | |
- name: Upload self-contained release | |
uses: actions/upload-artifact@v3 | |
with: | |
name: UserRights-net80-x64-self-contained | |
path: publish-packed | |
if-no-files-found: error | |
- name: Publish release | |
if: github.ref_type == 'tag' | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: UserRights-net80-x64.zip,UserRights-net80-x64-self-contained.zip |