Skip to content

chore(deps): update go module directive to v1.27.0 #60

chore(deps): update go module directive to v1.27.0

chore(deps): update go module directive to v1.27.0 #60

Workflow file for this run

name: Automatically create patch releases when renovate merges a PR to main
on:
push:
branches:
- main
jobs:
determine-version:
runs-on: ubuntu-latest
if: ${{ github.actor == 'renovate[bot]' }}
outputs:
NEW_VERSION: ${{ steps.versions.outputs.NEW_VERSION }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
fetch-tags: true
- id: versions
run: |
CURRENT_VERSION=$(git describe --tags --abbrev=0)
NEW_VERSION=v$(npx semver "$CURRENT_VERSION" -i patch)
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
# Build the version that is about to be tagged, before the tag exists. A tag
# that turns out unbuildable would otherwise have to be deleted, and a
# re-pushed tag is permanently broken for Go module consumers: the proxy
# caches the first SHA it saw.
verify-build:
needs: determine-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: thetillhoff/action-golang-build@b94bf8d46bc2dd0f7324fcbd0c6530838943976e # v1.1.0
with:
OS: linux
ARCH: amd64
BUILDARGS: -ldflags="-X github.com/thetillhoff/temingo/cmd.version=${{ needs.determine-version.outputs.NEW_VERSION }}"
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
merge-multiple: true
- name: Verify version
shell: bash
run: |
chmod +x ./temingo_linux_amd64
VERSION_OUTPUT=$(./temingo_linux_amd64 --version 2>&1 || echo "dev")
VERSION_OUTPUT=$(echo "$VERSION_OUTPUT" | tr -d '\n\r' | xargs)
EXPECTED_VERSION="${{ needs.determine-version.outputs.NEW_VERSION }}"
if [[ "$VERSION_OUTPUT" != "$EXPECTED_VERSION" ]]; then
echo "ERROR: Version mismatch! Expected: '$EXPECTED_VERSION', Got: '$VERSION_OUTPUT'"
exit 1
fi
echo "✓ Version verification passed: $VERSION_OUTPUT"
git-tag:
needs:
- determine-version
- verify-build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- run: |
git tag "${{ needs.determine-version.outputs.NEW_VERSION }}"
git push origin "${{ needs.determine-version.outputs.NEW_VERSION }}"
# A tag pushed with GITHUB_TOKEN does not fire `on: push: tags:`, so the
# release has to be called directly. The local path keeps caller and callee on
# the same commit; a pinned remote SHA silently runs an older release workflow.
trigger-release:
needs:
- determine-version
- git-tag
permissions:
contents: write
packages: write
uses: ./.github/workflows/release-golang-executable-on-tag.yaml
with:
tag: ${{ needs.determine-version.outputs.NEW_VERSION }}
# These releases get no CHANGELOG entry, so the body carries the fixed
# text one would have contained. Writing it needed a bot commit on main,
# which stops working the moment main requires a passing check: a
# GITHUB_TOKEN commit triggers no workflows, so the check never runs.
release_body: "Updated dependencies."