Skip to content

Release πŸš€

Release πŸš€ #3

Workflow file for this run

name: Release πŸš€
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: 'Git tag to create'
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=${GIT_TAG}
env:
GIT_TAG: ${{ github.event.inputs.tag }}
- 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: ${{ github.event.inputs.tag }}
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 }}