Skip to content

Release

Release #3

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: >-
Existing version tag to re-publish (e.g. v0.200.0).
Leave empty to bump and release a new version.
required: false
jobs:
release:
# This workflow should always be run on main - this is enforced by the
# `release` environment directly but added here for visibility.
# If the workflow fails during publishing, run a new workflow
# with the `version` that needs to be published.
if: github.ref == 'refs/heads/main' && github.run_attempt == '1'
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
persist-credentials: true
- name: Configure Git
run: |
git config user.name "planetscale-actions-bot"
git config user.email "60239337+planetscale-actions-bot@users.noreply.github.com"
- name: Checkout existing tag
if: inputs.version != ''
run: git checkout "refs/tags/$VERSION"
env:
VERSION: ${{ inputs.version }}
- name: Bump version and push tag
if: inputs.version == ''
id: bump
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: script/bump-version.sh
- name: Resolve version
id: version
env:
INPUT_VERSION: ${{ inputs.version }}
BUMP_VERSION: ${{ steps.bump.outputs.RELEASE_VERSION }}
run: echo "TAG=${INPUT_VERSION:-$BUMP_VERSION}" >> "$GITHUB_OUTPUT"
- name: Publish artifacts
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.TAG }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
AUR_KEY: ${{ secrets.AUR_KEY }}
run: script/release.sh