From 87a5649e0608bebe91b02599e0cd7ede2b961b74 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Tue, 8 Feb 2022 15:27:05 -0800 Subject: [PATCH] ci: Add workflow for automated release PRs --- .github/workflows/release.yaml | 53 ++++++++++++++++++++++++++++++++++ lib/player.js | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000000..11f2ab9a69 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,53 @@ +on: + push: + branches: + - master + - v[0-9]* + +name: Release + +jobs: + release: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + # Create/update release PR + - uses: google-github-actions/release-please-action@v3 + id: release + with: + # Required input to specify the release type (node package). + release-type: node + # Make sure the player version gets updated. + extra-files: lib/player.js + # Make sure we create the PR against the correct branch. + default-branch: ${{ github.ref_name }} + + # The jobs below are all conditional on a release having been created by + # someone merging the release PR. They all run in parallel. + + npm: + runs-on: ubuntu-latest + needs: release + if: ${{ needs.release.outputs.release_created }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - run: npm pack + - uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ needs.release.outputs.tag_name }} + file: shaka-player-*.tgz + file_glob: true + overwrite: true + + # TODO: Publish to appspot diff --git a/lib/player.js b/lib/player.js index 81f4317510..1a9db6a481 100644 --- a/lib/player.js +++ b/lib/player.js @@ -6102,7 +6102,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5; * @define {string} A version number taken from git at compile time. * @export */ -shaka.Player.version = 'v3.1.5-uncompiled'; +shaka.Player.version = 'v3.1.5-uncompiled'; // x-release-please-version // Initialize the deprecation system using the version string we just set // on the player.