Skip to content

Release πŸš€

Release πŸš€ #17

Workflow file for this run

name: Release πŸš€
on:
workflow_dispatch:
inputs:
semver:
type: string
required: true
description: 'Semver for release. (e.g. 0.0.1) Not prefix v!'
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Try to update inline versions
run: |
make update-versions VERSION=${SEMVER}
env:
SEMVER: ${{ github.event.inputs.semver }}
- name: Check Diff
id: diff
run: |
git add -N .
git diff --name-only --exit-code
continue-on-error: true
- name: Commit & Push
if: steps.diff.outcome == 'failure'
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit --author=. -m 'Auto Update by Release Action'
git push
- name: Create tag
run: |
git tag ${GIT_TAG}
git push origin ${GIT_TAG}
env:
GIT_TAG: v${{ github.event.inputs.semver }}
create-release:
runs-on: ubuntu-latest
needs: create-tag
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- run: go version
- name: GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}