From 046d18d0772de4c3c64eed1b4a33192f53659854 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Thu, 29 Jan 2026 11:06:31 +0100 Subject: [PATCH] chore: work save --- .github/workflows/publish.yaml | 116 ++---------------- sample/postgres/postresql.tf | 2 +- .../internal/wait/postgresflexalpha/wait.go | 2 +- 3 files changed, 14 insertions(+), 106 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 70897b20..9b30e545 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,85 +13,9 @@ env: CODE_COVERAGE_ARTIFACT_NAME: "code-coverage" jobs: - prep: - name: prepare - 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. - pull-requests: write # Required to add PR comment. - steps: - - name: Install prerequisites - run: | - apt-get -qq -y update - apt-get -qq -y install unzip zip - - - name: Checkout - uses: actions/checkout@v6 - - - name: Install Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v6 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Setup Terraform - uses: hashicorp/setup-terraform@v3 - with: - terraform_wrapper: false - # terraform_version: "1.1.7" - -# - run: terraform init - -# - id: plan -# run: terraform plan -no-color - -# - run: echo ${{ steps.plan.outputs.stdout }} -# - run: echo ${{ steps.plan.outputs.stderr }} -# - run: echo ${{ steps.plan.outputs.exitcode }} - - # Run plan by default, or apply on merge. -# - uses: op5dev/tf-via-pr@v13 -# with: -# working-directory: path/to/directory -# command: ${{ github.event_name == 'push' && 'apply' || 'plan' }} -# arg-lock: ${{ github.event_name == 'push' }} -# arg-backend-config: env/dev.tfbackend -# arg-var-file: env/dev.tfvars -# arg-workspace: dev-use1 -# plan-encrypt: ${{ secrets.PASSPHRASE }} - -# - name: "Ensure docs are up-to-date" -# if: ${{ github.event_name == 'pull_request' }} -# run: ./scripts/check-docs.sh -# continue-on-error: true - -# - name: "Run go mod tidy" -# if: ${{ github.event_name == 'pull_request' }} -# run: go mod tidy - -# - name: golangci-lint -# uses: golangci/golangci-lint-action@v9 -# with: -# version: v2.7 -# args: --config=golang-ci.yaml --allow-parallel-runners --timeout=5m - -# - name: Lint -# run: make lint - -# - name: Test -# run: make test - -# - name: Archive code coverage results -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }} -# path: "stackit/${{ env.CODE_COVERAGE_FILE_NAME }}" - - config: name: Check GoReleaser config - if: github.event_name == 'pull_request' + #if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Checkout @@ -102,28 +26,11 @@ jobs: with: args: check - code_coverage: - name: "Code coverage report" - if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) - runs-on: ubuntu-latest - needs: prep - permissions: - contents: read - actions: read # to download code coverage results from "main" job - pull-requests: write # write permission needed to comment on PR - steps: - - name: Check new code coverage - uses: fgrosse/go-coverage-report@v1.2.0 - continue-on-error: true # Add this line to prevent pipeline failures in forks - with: - coverage-artifact-name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }} - coverage-file-name: ${{ env.CODE_COVERAGE_FILE_NAME }} - root-package: 'tfregistry.sysops.stackit.rocks/mhenselin/stackitprivatepreview' - publish: name: "Publish provider" # if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') if: github.event_name == 'push' + needs: config runs-on: ubuntu-latest permissions: actions: read # Required to identify workflow run. @@ -189,15 +96,16 @@ jobs: - name: Prepare provider directory structure run: | - VERSION=$(jq -c .version < dist/metadata.json) - go run main.go \ - -ns=mhenselin \ - -p=stackitprivatepreview \ - -r=terraform-provider-stackitprivatepreview \ - -d=tfregistry.sysops.stackit.rocks \ - -gf=${{ secrets.GPG_FINGERPRINT }} \ - -gk=public_key.pem \ - -v=${VERSION} + VERSION=$(jq -r .version < dist/metadata.json) + go run cmd/main.go \ + publish \ + --namespace=mhenselin \ + --providerName=stackitprivatepreview \ + --repoName=terraform-provider-stackitprivatepreview \ + --domain=tfregistry.sysops.stackit.rocks \ + --gpgFingerprint=${{ secrets.GPG_FINGERPRINT }} \ + --gpgPubKeyFile=public_key.pem \ + --version=${VERSION} - name: Publish provider to S3 run: | diff --git a/sample/postgres/postresql.tf b/sample/postgres/postresql.tf index 44c2993e..fa2f49e8 100644 --- a/sample/postgres/postresql.tf +++ b/sample/postgres/postresql.tf @@ -32,7 +32,7 @@ resource "stackitprivatepreview_postgresflexalpha_instance" "msh-sna-pe-example" acl = ["0.0.0.0/0", "193.148.160.0/19", "170.85.2.177/32"] access_scope = "PUBLIC" } - version = 14 + version = 17 } resource "stackitprivatepreview_postgresflexalpha_instance" "msh-sna-pe-example2" { diff --git a/stackit/internal/wait/postgresflexalpha/wait.go b/stackit/internal/wait/postgresflexalpha/wait.go index e0fe3b44..50ad9ea2 100644 --- a/stackit/internal/wait/postgresflexalpha/wait.go +++ b/stackit/internal/wait/postgresflexalpha/wait.go @@ -197,6 +197,6 @@ func PartialUpdateInstanceWaitHandler( } }, ) - handler.SetTimeout(45 * time.Minute) + handler.SetTimeout(45 * time.Minute).SetSleepBeforeWait(30 * time.Second) return handler }