Skip to content

Release

Release #102

Workflow file for this run

name: Release
on:
push:
tags:
- '!player/'
- 'v*'
jobs:
test_and_build:
uses: ./.github/workflows/ci.yml
download_and_publish:
needs: test_and_build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: develop
- name: Install dependencies
run: npm ci
- name: Read package.json version
uses: actions/github-script@v6
id: extract-version
with:
script: |
const { version } = require('./package.json')
core.setOutput('packageJsonVersion', version)
- uses: actions/download-artifact@v3
with:
path: .
- name: Unpackage artifact files
run: tar -xzvf artifact/artifact.tar.gz -C .
shell: bash
- name: Publish
run: ./publish.sh
shell: bash
env:
NPM_DRY_RUN: false
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Build documentation
run: npx typedoc
shell: bash
- name: Authenticate
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCS_CREDENTIALS }}
- name: Upload docs
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './docs/'
destination: "${{ secrets.GCS_BUCKET }}/player/ui/${{ steps.extract-version.outputs.packageJsonVersion }}"
- name: Upload docs for major version
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './docs/'
destination: "${{ secrets.GCS_BUCKET }}/player/ui/3"
- name: Notify team
run: node .github/scripts/notifySlackTeam.js 'success' 'CHANGELOG.md' ${{ secrets.RELEASE_SUCCESS_SLACK_WEBHOOK }}
handle_failure:
runs-on: ubuntu-latest
needs: [test_and_build, download_and_publish]
if: ${{ always() && (needs.download_and_publish.result == 'failure' || needs.test_and_build.result == 'failure') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: develop
- name: Notify team
run: node .github/scripts/notifySlackTeam.js 'failure' 'CHANGELOG.md' ${{ secrets.RELEASE_FAILURE_SLACK_WEBHOOK }} ${{ github.run_id }}