Skip to content

Update GitHub actions #35

Update GitHub actions

Update GitHub actions #35

Workflow file for this run

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 }}