Add files back #30
Workflow file for this run
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: The version to release | |
| push: | |
| tags: | |
| - "*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| goreleaser: | |
| runs-on: macos-13 | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - | |
| name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.24.1 | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "2.8.2" | |
| args: healthcheck | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "2.8.2" | |
| args: release --clean --verbose | |
| env: | |
| GITHUB_TOKEN: ${{secrets.PUBLISHER_TOKEN}} | |
| msi: | |
| needs: goreleaser | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download sail.exe | |
| id: download_exe | |
| shell: bash | |
| run: | | |
| gh release download "${GITHUB_REF#refs/tags/}" -p '*windows_amd64*.zip' | |
| printf "zip=%s\n" *.zip >> $GITHUB_OUTPUT | |
| unzip -o *.zip && rm -v *.zip | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Prepare PATH | |
| id: setupmsbuild | |
| uses: microsoft/[email protected] | |
| - name: Build MSI | |
| id: buildmsi | |
| shell: bash | |
| env: | |
| ZIP_FILE: ${{ steps.download_exe.outputs.zip }} | |
| MSBUILD_PATH: ${{ steps.setupmsbuild.outputs.msbuildPath }} | |
| run: | | |
| name="$(basename "$ZIP_FILE""_unsigned" ".zip")" | |
| version="$(echo -e ${GITHUB_REF#refs/tags/} | sed s/-.*$//)" | |
| "${MSBUILD_PATH}\MSBuild.exe" ./build/windows/sail.wixproj -p:SourceDir="$PWD" -p:OutputPath="$PWD" -p:OutputName="$name" -p:ProductVersion="$version" | |
| - name: Upload MSI | |
| shell: bash | |
| run: | | |
| tag_name="${GITHUB_REF#refs/tags/}" | |
| gh release upload "$tag_name" "$MSI_FILE" | |
| release_url="$(gh api repos/:owner/:repo/releases -q ".[]|select(.tag_name==\"${tag_name}\")|.url")" | |
| publish_args=( -F draft=false ) | |
| gh api -X PATCH "$release_url" "${publish_args[@]}" | |
| env: | |
| MSI_FILE: ${{ steps.buildmsi.outputs.msi }} | |
| DISCUSSION_CATEGORY: General | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |