From 9b1b4f3f22c205c26bad431ac3b615eb1a583e43 Mon Sep 17 00:00:00 2001 From: Hamish Forbes Date: Wed, 18 Sep 2024 15:12:57 +1200 Subject: [PATCH] Publish new provider version --- .github/workflows/release.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8a052d07..8fb6c443 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -55,4 +55,17 @@ jobs: SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }} SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_API_KEY_SECRET }} run: - spacectl provider create-version --type=nexus \ No newline at end of file + spacectl provider create-version --type=nexus + + - name: Publish provider + if: startsWith(github.ref, 'refs/tags/') + env: + GPG_KEY_ID: ${{ steps.import_gpg.outputs.keyid }} + SPACELIFT_API_KEY_ENDPOINT: https://spacelift.ktl.net + SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }} + SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_API_KEY_SECRET }} + run: | + spacectl provider list-versions --type nexus -o json > versions.json + VERSION_ID=$(jq --arg version "${{ github.ref_name }}" '.versions[] | select(.number == $version) | .id' versions.json) + echo "Publishing ID: $VERSION_ID" + spacectl provider publish-version --version=$VERSION_ID