Merge pull request #3 from jcasale/dev #34
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: 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: Setup dotnet | |
id: setup-dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: src/global.json | |
- run: echo '${{ steps.setup-dotnet.outputs.dotnet-version }}' | |
- name: Run tests | |
run: dotnet.exe test .\src\UserRights.sln --configuration Release --runtime win-x64 | |
- 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@v4 | |
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@v4 | |
with: | |
name: UserRights-net80-x64-self-contained | |
path: publish-packed | |
if-no-files-found: error | |
- name: Publish release | |
if: github.ref_type == 'tag' | |
run: | | |
@' | |
# Windows User Rights Assignment Utility | |
Compiled with .NET SDK ${{ steps.setup-dotnet.outputs.dotnet-version }} | |
## UserRights-net80-x64-self-contained.zip | |
Self-contained release for Windows x64 | |
## UserRights-net80-x64.zip | |
Framework-dependent release for Windows x64 | |
'@ |gh.exe release create ${{ github.ref }} --title ${{ github.ref_name }} --notes-file - UserRights-net80-x64.zip UserRights-net80-x64-self-contained.zip | |
env: | |
# Requires a personal access token with a fine-grained permission of contents:read/write. | |
GH_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} |