From 5a42898574d6222ae8698b1b99f62b15facf3007 Mon Sep 17 00:00:00 2001 From: Dany Pellerin Date: Thu, 5 Dec 2024 10:51:54 -0500 Subject: [PATCH] test --- .github/workflows/release.yml | 103 ++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c37d299e..eed58aab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: Release new version of Optable SDK and demos on: push: + branches: + - test-versions-to-update tags: - v[0-9]+.[0-9]+.[0-9]+ - v[0-9]+.[0-9]+.[0-9]+-* @@ -52,7 +54,7 @@ jobs: echo "SDK versions: ${{ steps.sdk-versions.outputs.versions }}" deploy-sdk-to-npm: - needs: [define-gcs-versions-to-update] + needs: [build, define-gcs-versions-to-update] runs-on: ubuntu-22.04 steps: - name: Checkout code @@ -79,8 +81,8 @@ jobs: echo '@optable:registry=https://registry.npmjs.org/' > ~/.npmrc echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_CI_ACCESS_TOKEN }}" >> ~/.npmrc - - name: Publish to NPM - run: npm publish --access public + # - name: Publish to NPM + # run: npm publish --access public deploy-sdk-to-gcs: needs: [deploy-sdk-to-npm, define-gcs-versions-to-update] @@ -88,6 +90,33 @@ jobs: matrix: sdk-version: ${{ fromJSON(needs.define-gcs-versions-to-update.outputs.sdk-versions) }} runs-on: ubuntu-22.04 + permissions: + contents: read + id-token: write + steps: + - name: Download web artifacts + uses: actions/download-artifact@v4 + with: + name: dist-web + path: browser/dist + + - uses: "google-github-actions/auth@v2" + with: + workload_identity_provider: ${{ env.workload_identity_provider }} + service_account: ${{ env.service-account }} + + # - name: Upload SDK to GCS bucket, upload new version + # uses: "google-github-actions/upload-cloud-storage@v2" + # with: + # path: "browser/dist/sdk.js" + # destination: "optable-web-sdk/${{ matrix.sdk-version }}" + + deploy-latest: + needs: [deploy-sdk-to-npm, define-gcs-versions-to-update] + strategy: + matrix: + sdk-version: ["latest"] + runs-on: ubuntu-22.04 permissions: contents: read id-token: write @@ -163,37 +192,37 @@ jobs: username: oauth2accesstoken password: ${{ steps.auth.outputs.access_token }} - - name: Publish web-sdk-demos to us-docker.pkg.dev - run: docker push us-docker.pkg.dev/optable-artifact-registry/optable/optable-web-sdk-demos:${{ github.ref_name }} - - slack-notification: - needs: [tests-prettier, build, deploy-sdk-to-npm, define-gcs-versions-to-update, deploy-sdk-to-gcs, deploy-demo] - runs-on: ubuntu-22.04 - if: ${{ failure() }} - steps: - - name: Post to Slack - uses: slackapi/slack-github-action@v2.0.0 - with: - method: chat.postMessage - token: "${{ secrets.SLACK_MESSENGER_APP_TOKEN }}" - payload: | - channel: "${{ secrets.ALERTS_SLACK_CHANNEL_ID }}" - text: "Release Optable-web-sdk: Failure\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - blocks: - - type: "header" - text: - type: "plain_text" - text: ":crybot: Release Optable-web-sdk" - emoji: true - - type: "section" - fields: - - type: "mrkdwn" - text: "*Status:*\nFailure" - - type: "mrkdwn" - text: "*Branch:*\n${{ github.ref_name }}" - - type: "mrkdwn" - text: "*Author:*\n${{ github.actor || github.triggering_actor }}" - - type: "mrkdwn" - text: ":x: *Workflow run:*\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - - type: "mrkdwn" - text: "*Mentions:*\n@here" + # - name: Publish web-sdk-demos to us-docker.pkg.dev + # run: docker push us-docker.pkg.dev/optable-artifact-registry/optable/optable-web-sdk-demos:${{ github.ref_name }} + + # slack-notification: + # needs: [tests-prettier, build, deploy-sdk-to-npm, define-gcs-versions-to-update, deploy-sdk-to-gcs, deploy-demo] + # runs-on: ubuntu-22.04 + # if: ${{ failure() }} + # steps: + # - name: Post to Slack + # uses: slackapi/slack-github-action@v2.0.0 + # with: + # method: chat.postMessage + # token: "${{ secrets.SLACK_MESSENGER_APP_TOKEN }}" + # payload: | + # channel: "${{ secrets.ALERTS_SLACK_CHANNEL_ID }}" + # text: "Release Optable-web-sdk: Failure\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # blocks: + # - type: "header" + # text: + # type: "plain_text" + # text: ":crybot: Release Optable-web-sdk" + # emoji: true + # - type: "section" + # fields: + # - type: "mrkdwn" + # text: "*Status:*\nFailure" + # - type: "mrkdwn" + # text: "*Branch:*\n${{ github.ref_name }}" + # - type: "mrkdwn" + # text: "*Author:*\n${{ github.actor || github.triggering_actor }}" + # - type: "mrkdwn" + # text: ":x: *Workflow run:*\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # - type: "mrkdwn" + # text: "*Mentions:*\n@here"