Skip to content

Rename project to Jesnote #30

Rename project to Jesnote

Rename project to Jesnote #30

Workflow file for this run

# Main workflow for building and releasing the Windows desktop app
name: CI/CD
env:
DOTNET_VERSION: "8.0.x"
NAME: "jesnote"
FULLNAME: "Jesnote"
PROJECT_PATH: "src/Jesnote.csproj"
VERSION: "0.0.0"
on: push
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build
run: dotnet build ${{ env.PROJECT_PATH }} -c Release --no-restore
package_windows:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set version
id: version
shell: pwsh
run: |
$version = "${{ github.ref_name }}".TrimStart("v")
"version=$version" >> $env:GITHUB_OUTPUT
"VERSION=$version" >> $env:GITHUB_ENV
- name: Publish
run: >
dotnet publish ${{ env.PROJECT_PATH }}
-c Release
-r win-x64
--self-contained false
-o publish/${{ env.FULLNAME }}
- name: Prepare package
shell: pwsh
run: |
Copy-Item README.md publish/${{ env.FULLNAME }}/README.md -Force
Copy-Item LICENSE publish/${{ env.FULLNAME }}/LICENSE -Force
Get-ChildItem publish/${{ env.FULLNAME }} -Filter *.pdb | Remove-Item -Force
Compress-Archive `
-Path publish/${{ env.FULLNAME }}/* `
-DestinationPath ${{ env.NAME }}-${{ steps.version.outputs.version }}-windows-x64.zip `
-Force
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: ${{ env.NAME }}-windows
path: ${{ env.NAME }}-${{ steps.version.outputs.version }}-windows-x64.zip
if-no-files-found: error
overwrite: true
release:
if: startsWith(github.ref, 'refs/tags/')
needs: package_windows
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
merge-multiple: true
- name: Set version
id: version
run: |
VERSION=${{ github.ref_name }}
echo "version=${VERSION:1}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v3
with:
fail_on_unmatched_files: true
files: ${{ env.NAME }}-${{ steps.version.outputs.version }}-windows-x64.zip