diff --git a/.github/workflows/spectro-release.yaml b/.github/workflows/spectro-release.yaml new file mode 100644 index 00000000..c2c4bb3e --- /dev/null +++ b/.github/workflows/spectro-release.yaml @@ -0,0 +1,77 @@ +name: Spectro Release +run-name: Release for Cluster API CloudStack ${{ github.event.inputs.release_version }} +on: + workflow_dispatch: + inputs: + release_version: + description: 'Cluster API Version to Build' + required: true + default: '0.0.0' + rel_type: + type: choice + description: Type of release + default: 'rc' + options: + - release + - rc +jobs: + builder: + runs-on: ubuntu-latest + env: + SPECTRO_VERSION: ${{ github.event.inputs.release_version }} + LEGACY_REGISTRY: us-docker.pkg.dev/palette-images/palette/cluster-api-cloudstack + FIPS_REGISTRY: us-docker.pkg.dev/palette-images-fips/palette/cluster-api-cloudstack + steps: + - uses: mukunku/tag-exists-action@v1.2.0 + id: checkTag + with: + tag: v${{ github.event.inputs.release_version }}-spectro + - if: ${{ steps.checkTag.outputs.exists == 'true' }} + run: | + echo "Tag already exists for v${{ github.event.inputs.release_version }}-spectro..." + exit 1 + - if: ${{ github.event.inputs.rel_type == 'rc' }} + run: | + echo "LEGACY_REGISTRY=us-east1-docker.pkg.dev/spectro-images/dev/cluster-api-cloudstack" >> $GITHUB_ENV + echo "FIPS_REGISTRY=us-east1-docker.pkg.dev/spectro-images/dev-fips/cluster-api-cloudstack" >> $GITHUB_ENV + - uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to private registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_URL }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Login to dev private registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.DEV_REGISTRY_URL }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Build Image + env: + REGISTRY: ${{ env.LEGACY_REGISTRY }} + run: | + make docker-build-all + make docker-push-all + - name: Build Image - FIPS Mode + env: + FIPS_ENABLE: yes + REGISTRY: ${{ env.FIPS_REGISTRY }} + run: | + make docker-build-all + make docker-push-all + - name: Create Release + if: ${{ github.event.inputs.rel_type == 'release' }} + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ github.event.inputs.release_version }}-spectro + release_name: Release v${{ github.event.inputs.release_version }}-spectro + body: | + Release version v${{ github.event.inputs.release_version }}-spectro + draft: false + prerelease: false \ No newline at end of file