Skip to content

Commit

Permalink
chore: update .NET version and enhance CI workflows
Browse files Browse the repository at this point in the history
Updated the .NET version in `build_app.yml` to '9.0.x' and modified artifact names to include "Velopack". Ensured upload steps are conditional on event type.

Added a new job in `releases.yml` for manual deployment to GitHub Releases, which includes steps for version retrieval, .NET installation, application publishing, and Velopack release creation.

Also, added a `<Version>` tag with '1.0.0' in `SketchNow.csproj` to specify the application version.
  • Loading branch information
realybin committed Jan 1, 2025
1 parent 3088033 commit 636450e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
dotnet-version: 9.0.x

- name: dotnet build
run: dotnet build --configuration Release -p:Version="${{ env.version }}"
Expand Down Expand Up @@ -62,21 +62,14 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
run: dotnet tool update -g vpk && vpk pack -u SketchNow -v ${{ env.version }} -p ${{github.workspace}}/.build/publish -e SketchNow.exe -o ${{github.workspace}}/.build/release

- name: Upload Publish artifact for deployment job
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: Publish
path: ${{github.workspace}}/.build/publish

- name: Upload Portable artifact for deployment job
- name: Upload Velopack Portable artifact for deployment job
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: Portable
path: ${{github.workspace}}/.build/release/SketchNow-win-Portable.zip

- name: Upload Installer artifact for deployment job
- name: Upload Velopack Installer artifact for deployment job
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy to GitHub Releases

on: workflow_dispatch
jobs:
deploy-to-github-releases:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- 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 --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 --publish --releaseName "SketchNow ${{ steps.get-version.outputs.version }}" --tag v${{ steps.get-version.outputs.version }} --token ${{ secrets.RELEASE_TOKEN }}
- name: Generate Release Notes
uses: yashanand1910/[email protected]
id: get_release_notes
with:
changelog_path: ./CHANGELOG.md
version: ${{ steps.get-version.outputs.version }}
body: ${{ steps.get_release_notes.outputs.release_notes }}
Empty file added CHANGELOG.md
Empty file.
1 change: 1 addition & 0 deletions SketchNow/SketchNow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<UseWPF>true</UseWPF>
<StartupObject>SketchNow.App</StartupObject>
<ApplicationIcon>Resources\AppIcon.ico</ApplicationIcon>
<Version>1.0.0</Version>
</PropertyGroup>

<!--
Expand Down

0 comments on commit 636450e

Please sign in to comment.