Skip to content

Commit

Permalink
ci: Add workflow for automated release PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Feb 16, 2022
1 parent 1842797 commit 87a5649
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .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
2 changes: 1 addition & 1 deletion lib/player.js
Expand Up @@ -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.
Expand Down

0 comments on commit 87a5649

Please sign in to comment.