-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c071bc
commit 5a42898
Showing
1 changed file
with
66 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,15 +81,42 @@ 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] | ||
strategy: | ||
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/[email protected] | ||
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/[email protected] | ||
# 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" |