Lorenz Brun | 02bc7de | 2022-06-30 17:01:36 +0000 | [diff] [blame^] | 1 | name: Publish release artifacts and docs for new tags |
| 2 | on: |
| 3 | push: |
| 4 | tags: |
| 5 | - "v*" |
| 6 | jobs: |
| 7 | publish: |
| 8 | runs-on: gha-trusted |
| 9 | permissions: |
| 10 | contents: "write" # Required for publishing release artifacts |
| 11 | id-token: "write" |
| 12 | steps: |
| 13 | - uses: actions/checkout@v3 |
| 14 | - id: auth |
| 15 | name: Authenticate to GCP |
| 16 | uses: google-github-actions/auth@v0.8.0 |
| 17 | with: |
| 18 | create_credentials_file: "true" |
| 19 | workload_identity_provider: "projects/498345658902/locations/global/workloadIdentityPools/oidc-fed/providers/github-actions" |
| 20 | service_account: "github-artifact-deploy@monogon-infra.iam.gserviceaccount.com" |
| 21 | - name: Set up Cloud SDK |
| 22 | uses: google-github-actions/setup-gcloud@v0 |
| 23 | - name: Install Cloud SDK alpha commands |
| 24 | run: gcloud --quiet components install alpha |
| 25 | - name: Build artifacts |
| 26 | run: bazel build -c opt //metropolis/node:bundle //metropolis/handbook //metropolis/cli/metroctl |
| 27 | - name: Attach artifacts to Release |
| 28 | uses: softprops/action-gh-release@v1 |
| 29 | with: |
| 30 | files: | |
| 31 | bazel-bin/metropolis/node/bundle.zip |
| 32 | bazel-bin/metropolis/cli/metroctl/metroctl_/metroctl |
| 33 | - name: Upload to GCS |
| 34 | run: |- |
| 35 | gcloud alpha storage cp bazel-bin/metropolis/node/bundle.zip gs://monogon-release-artifacts/${GITHUB_REF##*/}/bundle.zip |
| 36 | gcloud alpha storage cp bazel-bin/metropolis/cli/metroctl/metroctl_/metroctl gs://monogon-release-artifacts/${GITHUB_REF##*/}/metroctl |
| 37 | gcloud alpha storage cp -r bazel-bin/metropolis/handbook/handbook gs://monogon-release-artifacts/${GITHUB_REF##*/}/handbook |