Skip to content

chore: set version to v0.2.1, drop -dev suffix from CI #6

chore: set version to v0.2.1, drop -dev suffix from CI

chore: set version to v0.2.1, drop -dev suffix from CI #6

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to (re)release (e.g. v0.1.0)"
required: true
type: string
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Stash GoReleaser config
run: cp .goreleaser.yaml /tmp/.goreleaser.yaml
- name: Checkout release tag
if: ${{ github.event_name == 'workflow_dispatch' }}
run: git checkout ${{ inputs.tag }}
- name: GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean --config /tmp/.goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-version:
needs: goreleaser
runs-on: ubuntu-latest
steps:
- name: Get tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout main
uses: actions/checkout@v6
with:
ref: main
- name: Update version.go
run: |
TAG="${{ steps.tag.outputs.tag }}"
VERSION="${TAG#v}"
sed -i "s/version = \".*\"/version = \"${VERSION}\"/" internal/cmd/version.go
cat internal/cmd/version.go
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add internal/cmd/version.go
git diff --cached --quiet && exit 0
git commit -m "chore: set version to ${{ steps.tag.outputs.tag }}"
git push origin main
update-homebrew:
needs: goreleaser
runs-on: ubuntu-latest
steps:
- name: Get tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
fi
- name: Trigger homebrew-tap update
run: |
gh workflow run update-formula.yml \
--repo bpauli/homebrew-tap \
--field formula=obsync \
--field tag=${{ steps.tag.outputs.tag }} \
--field repository=bpauli/obsync
env:
GH_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}