|
| 1 | +name: Spectro Release |
| 2 | +run-name: Release for Cluster API Maas ${{ github.event.inputs.release_version }} |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release_version: |
| 7 | + description: 'Cluster API Version to Build' |
| 8 | + required: true |
| 9 | + default: '0.0.0' |
| 10 | +jobs: |
| 11 | + builder: |
| 12 | + # edge-runner machine group is a bunch of machines in US Datacenter |
| 13 | + runs-on: ubuntu-latest |
| 14 | + # Initialize all secrets required for the job |
| 15 | + # Ensure that the credentials are provided as encrypted secrets |
| 16 | + env: |
| 17 | + SPECTRO_VERSION: ${{ github.event.inputs.release_version }} |
| 18 | + steps: |
| 19 | + - |
| 20 | + |
| 21 | + id: checkTag |
| 22 | + with: |
| 23 | + tag: v${{ github.event.inputs.release_version }}-spectro |
| 24 | + - |
| 25 | + if: ${{ steps.checkTag.outputs.exists == 'true' }} |
| 26 | + run: | |
| 27 | + echo "Tag already exists for v${{ github.event.inputs.release_version }}-spectro..." |
| 28 | + exit 1 |
| 29 | + - |
| 30 | + uses: actions/checkout@v3 |
| 31 | + - |
| 32 | + name: Set up Docker Buildx |
| 33 | + uses: docker/setup-buildx-action@v1 |
| 34 | + - |
| 35 | + name: Login to private registry |
| 36 | + uses: docker/login-action@v1 |
| 37 | + with: |
| 38 | + registry: ${{ secrets.REGISTRY_URL }} |
| 39 | + username: ${{ secrets.REGISTRY_USERNAME }} |
| 40 | + password: ${{ secrets.REGISTRY_PASSWORD }} |
| 41 | + - |
| 42 | + name: Build Image |
| 43 | + env: |
| 44 | + REGISTRY: gcr.io/spectro-images-public/release/cluster-api-maas |
| 45 | + run: | |
| 46 | + make docker-build |
| 47 | + make docker-push |
| 48 | + - |
| 49 | + name: Build Image - FIPS Mode |
| 50 | + env: |
| 51 | + FIPS_ENABLE: yes |
| 52 | + REGISTRY: gcr.io/spectro-images-public/release-fips/cluster-api-maas |
| 53 | + run: | |
| 54 | + make docker-build |
| 55 | + make docker-push |
| 56 | + - |
| 57 | + name: Create Release |
| 58 | + id: create_release |
| 59 | + uses: actions/create-release@v1 |
| 60 | + env: |
| 61 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + with: |
| 63 | + tag_name: v${{ github.event.inputs.release_version }}-spectro |
| 64 | + release_name: Release v${{ github.event.inputs.release_version }}-spectro |
| 65 | + body: | |
| 66 | + Release version ${{ github.event.inputs.release_version }} |
| 67 | + draft: false |
| 68 | + prerelease: false |
0 commit comments