Deploy to GitHub Releases #7
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: Deploy to GitHub Releases | |
on: workflow_dispatch | |
jobs: | |
deploy-to-github-releases: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: dotnet build | |
run: dotnet build --configuration Release -p:Version="${{ env.version }}" | |
- name: dotnet test | |
run: dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage" --results-directory ${{github.workspace}}/.build/coverage | |
- name: Upload Code Coverage Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CodeCoverage | |
path: ${{github.workspace}}/.build/coveragereport/ | |
if-no-files-found: error | |
- name: Get Version from Project File | |
id: get-version | |
shell: bash | |
run: echo "version=$(grep -oE '<Version>[^<]+' SketchNow/SketchNow.csproj | sed 's/<Version>//')" >> $GITHUB_OUTPUT | |
- name: Install .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Publish Application | |
if: ${{ github.event_name != 'pull_request' }} | |
run: dotnet publish --no-build --configuration Release -p:PublishDir=${{ github.workspace }}/.build/publish -r win-x64 --self-contained true | |
- name: Create Velopack Release | |
run: | | |
dotnet tool install -g vpk | |
vpk download github --repoUrl https://github.com/SketchNow/SketchNow.WPF | |
vpk pack -u SketchNow -v ${{ steps.get-version.outputs.version }} -p ${{ github.workspace }}/.build/publish | |
vpk upload github --repoUrl https://github.com/SketchNow/SketchNow.WPF --releaseName "SketchNow ${{ steps.get-version.outputs.version }}" --tag v${{ steps.get-version.outputs.version }} --token ${{ secrets.RELEASE_TOKEN }} |