From 26cada8f397f8b4a2576ec5d457a2d3398e64843 Mon Sep 17 00:00:00 2001 From: Hamish Forbes Date: Tue, 17 Sep 2024 17:07:31 +1200 Subject: [PATCH] Publish new provider version --- .github/workflows/release.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8a052d07..7aa31475 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -55,4 +55,11 @@ 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/') + 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) + spacectl provider publish-version --type=nexus --version=$VERSION_ID