feat: Warn user on startup if a mixed v1/v2 install is detected #356
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: [ "v*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: [windows-2022, windows-11-arm] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| arch: ${{ matrix.os == 'windows-2022' && 'x64' || (matrix.os == 'windows-11-arm' && 'arm64' || 'unknown') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install .NET Core | |
| uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run Tests | |
| run: task test | |
| - name: Build SyncTrayzor (Portable) | |
| run: task build-portable | |
| - name: Upload portable dist | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: SyncTrayzorPortable-${{ env.arch }}.zip | |
| path: ./release/SyncTrayzorPortable-${{ env.arch }}.zip | |
| - name: Build SyncTrayzor Installer | |
| run: task build-installer | |
| - name: Upload installer dist | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: SyncTrayzorSetup-${{ env.arch }}.exe | |
| path: ./release/SyncTrayzorSetup-${{ env.arch }}.exe | |
| release: | |
| if: github.ref_type == 'tag' | |
| needs: build | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: write | |
| discussions: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6 | |
| with: | |
| path: "${{ github.workspace }}/release" | |
| merge-multiple: true | |
| - name: Install .NET Core | |
| uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Write private key to file | |
| run: | | |
| cat << EOF > synctrayzor_private_key.asc | |
| ${{ secrets.SYNCTRAYZOR_PRIVATE_KEY }} | |
| EOF | |
| shell: bash | |
| - name: Sign artifacts | |
| run: task sign-release | |
| env: | |
| SYNCTRAYZOR_PRIVATE_KEY: "${{ github.workspace }}\\synctrayzor_private_key.asc" | |
| SYNCTRAYZOR_PRIVATE_KEY_PASSPHRASE: "${{ secrets.SYNCTRAYZOR_PRIVATE_KEY_PASSPHRASE }}" | |
| - name: Upload signature file | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: sha512sum.txt.asc | |
| path: release/sha512sum.txt.asc | |
| - name: Get version from tag | |
| id: tag_name | |
| run: | | |
| echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Get Changelog Entry | |
| id: changelog_reader | |
| uses: mindsers/changelog-reader-action@32aa5b4c155d76c94e4ec883a223c947b2f02656 # v2 | |
| with: | |
| validation_level: warn | |
| version: ${{ steps.tag_name.outputs.current_version }} | |
| path: ./CHANGELOG.md | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2 | |
| with: | |
| files: | | |
| release/** | |
| name: Release ${{ steps.changelog_reader.outputs.version }} | |
| body: ${{ steps.changelog_reader.outputs.changes }} | |
| prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} | |
| draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} | |
| discussion_category_name: "Releases" | |
| preserve_order: true | |
| fail_on_unmatched_files: true | |
| append_body: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Chocolatey Extensions | |
| run: choco install chocolatey-community-validation.extension -y | |
| shell: powershell | |
| - name: Build Chocolatey Package | |
| run: task build-choco-package | |
| env: | |
| SYNCTRAYZOR_VERSION: ${{ steps.changelog_reader.outputs.version }} | |
| SYNCTRAYZOR_RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }} | |
| - name: Upload choco package | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| path: ./release/synctrayzor*.nupkg | |
| - name: Push Chocolatey Package | |
| if: steps.changelog_reader.outputs.status != 'prereleased' && steps.changelog_reader.outputs.status != 'unreleased' | |
| run: | | |
| $packagePath = Get-ChildItem "${{ github.workspace }}/release" -Filter "synctrayzor*.nupkg" | Select-Object -ExpandProperty FullName | |
| choco apikey --key ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/ | |
| choco push $packagePath --source https://push.chocolatey.org/ | |
| shell: powershell | |
| - name: Publish to winget | |
| uses: vedantmgoyal9/winget-releaser@main | |
| with: | |
| identifier: GermanCoding.SyncTrayzor | |
| installers-regex: '-x64\.exe$' | |
| max-versions-to-keep: 5 # keep only latest 5 versions | |
| token: ${{ secrets.WINGET_TOKEN }} |