MEDIUM: add support for scheduled tasks via cron expressions #5
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: goreleaser | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| # Rebuild an existing tag with the current Go toolchain (e.g. CVE fix in Go). | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to rebuild and re-release (e.g. v0.5.0); empty = latest tag" | |
| required: false | |
| default: "" | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || '' }} | |
| - name: Check out latest tag | |
| if: github.event_name == 'workflow_dispatch' && inputs.tag == '' | |
| run: git checkout "$(git tag --sort=-v:refname | head -n1)" | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: 'go.mod' | |
| check-latest: true | |
| # setup-go exports GOTOOLCHAIN=local via GITHUB_ENV; a later write wins. | |
| - name: Allow Go toolchain downloads | |
| run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV" | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |