Update GitHub actions #35
Workflow file for this run
This file contains 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: | |
branches: | |
- main | |
tags: | |
# Create a release on a tag push | |
- "*" | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref_name != 'main' }} | |
permissions: | |
contents: write | |
# packages: write | |
# issues: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- | |
name: Fetch all tags | |
run: git fetch --force --tags | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20" | |
- name: Print Go version | |
run: go version | |
- name: Print supported platforms | |
run: go tool dist list | |
- name: Set ui_file | |
id: vars | |
run: | | |
echo "ui_file=$(pwd)/.tmp/ui.tar.gz" >> $GITHUB_OUTPUT | |
- name: Dry-run GoReleaser | |
if: ${{ github.ref_type != 'tag' }} | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist --skip-validate --skip-publish | |
env: | |
UI_SEPARATOR: "--------UI--------" | |
UI_FILE: ${{ steps.vars.outputs.ui_file }} | |
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution | |
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
- name: Run GoReleaser | |
if: ${{ github.ref_type == 'tag' }} | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
UI_SEPARATOR: "--------UI--------" | |
UI_FILE: ${{ steps.vars.outputs.ui_file }} | |
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution | |
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} |