chore: update publish pipeline (#90)

[skip ci]

## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

relates to #1234

## Checklist

- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)

Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Reviewed-on: #90
This commit is contained in:
Marcel_Henselin 2026-03-17 16:21:23 +00:00
parent 76af35f27d
commit a1d1750a79
Signed by: tf-provider.git.onstackit.cloud
GPG key ID: 6D7E8A1ED8955A9C

View file

@ -3,6 +3,8 @@ name: Publish
run-name: Publish by @${{ github.actor }}
on:
workflow_dispatch:
push:
tags:
- 'v0.*'
@ -15,7 +17,6 @@ env:
jobs:
config:
name: Check GoReleaser config
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -28,13 +29,12 @@ jobs:
publish:
name: "Publish provider"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: config
runs-on: ubuntu-latest
permissions:
actions: read # Required to identify workflow run.
checks: write # Required to add status summary.
contents: read # Required to checkout repository.
contents: write # Required to checkout repository.
pull-requests: write # Required to add PR comment.
steps:
- name: Install needed tools
@ -81,15 +81,15 @@ jobs:
gpg --import ~/private.key.pem
rm ~/private.key.pem
- name: Run GoReleaser with SNAPSHOT
if: github.event_name == 'workflow_dispatch'
id: goreleaser
env:
GITHUB_TOKEN: ${{ env.FORGEJO_TOKEN }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
uses: goreleaser/goreleaser-action@v7
with:
args: release --skip publish --clean --snapshot
# - name: Run GoReleaser with SNAPSHOT
# if: github.event_name == 'workflow_dispatch'
# id: goreleaser
# env:
# GITHUB_TOKEN: ${{ env.FORGEJO_TOKEN }}
# GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
# uses: goreleaser/goreleaser-action@v7
# with:
# args: release --skip publish --clean --snapshot
- name: Run GoReleaser
if: github.event_name != 'workflow_dispatch'
@ -105,9 +105,14 @@ jobs:
run: |
echo "${{ secrets.PUBLIC_KEY_PEM }}" >public_key.pem
- name: Prepare provider directory structure
- name: Determine version
id: get_version
run: |
VERSION=$(jq -r .version < dist/metadata.json)
echo "version=${VERSIO)N}" >> "$GITHUB_OUTPUT"
- name: Prepare provider directory structure
run: |
go run generator/main.go \
publish \
--namespace=mhenselin \
@ -116,7 +121,7 @@ jobs:
--domain=tfregistry.sysops.stackit.rocks \
--gpgFingerprint="${{ secrets.GPG_FINGERPRINT }}" \
--gpgPubKeyFile=public_key.pem \
--version=${VERSION}
--version=${{ steps.get_version.outputs.version }}
- name: Prepare documentation nav file
run: |
@ -141,6 +146,7 @@ jobs:
run: |
set -e
ssh -o StrictHostKeyChecking=no ubuntu@${{ vars.DOCS_SERVER_IP }} 'rm -rf /srv/www/docs'
echo "${{ github.ref_name }}" >docs/_version.txt
echo "${{ steps.get_version.outputs.version }}" >docs/_version.txt
# echo "${{ github.ref_name }}" >docs/_version.txt
scp -o StrictHostKeyChecking=no -r docs ubuntu@${{ vars.DOCS_SERVER_IP }}:/srv/www/
scp -o StrictHostKeyChecking=no nav.md ubuntu@${{ vars.DOCS_SERVER_IP }}:/srv/www/