Require repo init before adopting root #1
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: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Set up GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| install-only: true | |
| - name: Resolve release version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "value=dev-manual" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "value=${GITHUB_REF_NAME}" >> "${GITHUB_OUTPUT}" | |
| fi | |
| - name: Build and publish release archives with GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "~> v2" | |
| args: ${{ github.event_name == 'workflow_dispatch' && 'release --clean --snapshot' || 'release --clean' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_VERSION_OVERRIDE: ${{ steps.version.outputs.value }} | |
| - name: Generate Homebrew formula | |
| run: | | |
| ./scripts/generate-homebrew-formula.sh \ | |
| --version "${{ steps.version.outputs.value }}" \ | |
| --checksums dist/SHA256SUMS \ | |
| --output dist/mainline.rb | |
| ruby -c dist/mainline.rb | |
| - name: Generate release manifest | |
| run: | | |
| ./scripts/generate-release-manifest.sh \ | |
| --version "${{ steps.version.outputs.value }}" \ | |
| --checksums dist/SHA256SUMS \ | |
| --output dist/release-manifest.json | |
| - name: Package versioned release assets | |
| run: ./scripts/package-release-assets.sh --version "${{ steps.version.outputs.value }}" --dist dist | |
| - name: Upload workflow artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mainline-${{ steps.version.outputs.value }} | |
| path: dist/* | |
| - name: Upload supplemental release assets | |
| if: github.event_name != 'workflow_dispatch' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ steps.version.outputs.value }} | |
| tag_name: ${{ steps.version.outputs.value }} | |
| files: | | |
| dist/mainline.rb | |
| dist/mainline_*.rb | |
| dist/release-manifest.json | |
| dist/release-manifest_*.json | |
| dist/mainline_packages_*.tar.gz |