|
| 1 | +name: Release StickyNote Installers |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: {} |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-release: |
| 14 | + runs-on: windows-latest |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Setup .NET 8 |
| 20 | + uses: actions/setup-dotnet@v4 |
| 21 | + with: |
| 22 | + dotnet-version: '8.0.x' |
| 23 | + |
| 24 | + - name: Restore |
| 25 | + run: dotnet restore |
| 26 | + |
| 27 | + - name: Publish Slim binaries (x64/x86) |
| 28 | + shell: pwsh |
| 29 | + run: | |
| 30 | + dotnet publish StickyNote.csproj -c Release -r win-x64 /p:PublishSingleFile=true /p:SelfContained=false -o publish-slim/win-x64 |
| 31 | + dotnet publish StickyNote.csproj -c Release -r win-x86 /p:PublishSingleFile=true /p:SelfContained=false -o publish-slim/win-x86 |
| 32 | +
|
| 33 | + - name: Publish Self-contained binaries (x64/x86) |
| 34 | + shell: pwsh |
| 35 | + run: | |
| 36 | + dotnet publish StickyNote.csproj -c Release -r win-x64 /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true -o publish-sc/win-x64 |
| 37 | + dotnet publish StickyNote.csproj -c Release -r win-x86 /p:PublishSingleFile=true /p:SelfContained=true /p:IncludeNativeLibrariesForSelfExtract=true -o publish-sc/win-x86 |
| 38 | +
|
| 39 | + - name: Install Inno Setup |
| 40 | + shell: pwsh |
| 41 | + run: | |
| 42 | + choco install innosetup -y |
| 43 | +
|
| 44 | + - name: Compile installers (Slim & Full x64/x86) |
| 45 | + shell: pwsh |
| 46 | + run: | |
| 47 | + $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" |
| 48 | + & $iscc 'installer\StickyNote_slim.iss' /DArch=x64 |
| 49 | + & $iscc 'installer\StickyNote_slim.iss' /DArch=x86 |
| 50 | + & $iscc 'installer\StickyNote_sc.iss' /DArch=x64 |
| 51 | + & $iscc 'installer\StickyNote_sc.iss' /DArch=x86 |
| 52 | +
|
| 53 | + - name: Upload installers artifact |
| 54 | + uses: actions/upload-artifact@v4 |
| 55 | + with: |
| 56 | + name: sticky-note-installers |
| 57 | + path: | |
| 58 | + installer/out/*.exe |
| 59 | +
|
| 60 | + - name: Create GitHub Release |
| 61 | + if: startsWith(github.ref, 'refs/tags/') |
| 62 | + id: create_release |
| 63 | + uses: actions/create-release@v1 |
| 64 | + env: |
| 65 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + with: |
| 67 | + tag_name: ${{ github.ref_name }} |
| 68 | + release_name: StickyNote ${{ github.ref_name }} |
| 69 | + draft: false |
| 70 | + prerelease: false |
| 71 | + |
| 72 | + - name: Upload asset Slim x64 |
| 73 | + if: startsWith(github.ref, 'refs/tags/') |
| 74 | + uses: actions/upload-release-asset@v1 |
| 75 | + env: |
| 76 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + with: |
| 78 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 79 | + asset_path: installer/out/StickyNote_Setup_Slim_x64.exe |
| 80 | + asset_name: StickyNote_Setup_Slim_x64.exe |
| 81 | + asset_content_type: application/octet-stream |
| 82 | + |
| 83 | + - name: Upload asset Slim x86 |
| 84 | + if: startsWith(github.ref, 'refs/tags/') |
| 85 | + uses: actions/upload-release-asset@v1 |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + with: |
| 89 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 90 | + asset_path: installer/out/StickyNote_Setup_Slim_x86.exe |
| 91 | + asset_name: StickyNote_Setup_Slim_x86.exe |
| 92 | + asset_content_type: application/octet-stream |
| 93 | + |
| 94 | + - name: Upload asset Full x64 |
| 95 | + if: startsWith(github.ref, 'refs/tags/') |
| 96 | + uses: actions/upload-release-asset@v1 |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + with: |
| 100 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 101 | + asset_path: installer/out/StickyNote_Setup_x64.exe |
| 102 | + asset_name: StickyNote_Setup_x64.exe |
| 103 | + asset_content_type: application/octet-stream |
| 104 | + |
| 105 | + - name: Upload asset Full x86 |
| 106 | + if: startsWith(github.ref, 'refs/tags/') |
| 107 | + uses: actions/upload-release-asset@v1 |
| 108 | + env: |
| 109 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 110 | + with: |
| 111 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 112 | + asset_path: installer/out/StickyNote_Setup_x86.exe |
| 113 | + asset_name: StickyNote_Setup_x86.exe |
| 114 | + asset_content_type: application/octet-stream |
0 commit comments