Skip to content

Commit e2ec5eb

Browse files
authored
ci: Add workflow for automated release PRs (shaka-project#3942)
This includes a temporary config file to bootstrap the workflow for the master branch, whose commit and branch history is too confusing for the tool to handle with defaults. After v3.4.0 is released from the master branch, these configs can be deleted.
1 parent 4bb2c14 commit e2ec5eb

6 files changed

+73
-1
lines changed

.github/workflows/release.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- v[0-9]*
6+
7+
name: Release
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
release_created: ${{ steps.release.outputs.release_created }}
14+
tag_name: ${{ steps.release.outputs.tag_name }}
15+
steps:
16+
# Create/update release PR
17+
- uses: google-github-actions/release-please-action@v3
18+
id: release
19+
with:
20+
# Without this command, the manifest file will be ignored. At least
21+
# for our initial master-branch releases using this workflow, we must
22+
# use the manifest and config file.
23+
command: manifest
24+
config-file: .release-please-config.json
25+
manifest-file: .release-please-manifest.json
26+
# Make sure the player version gets updated.
27+
extra-files: lib/player.js
28+
# Make sure we create the PR against the correct branch.
29+
default-branch: ${{ github.ref_name }}
30+
31+
# The jobs below are all conditional on a release having been created by
32+
# someone merging the release PR. They all run in parallel.
33+
34+
npm:
35+
runs-on: ubuntu-latest
36+
needs: release
37+
if: ${{ needs.release.outputs.release_created }}
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions/setup-node@v1
41+
with:
42+
node-version: 12
43+
registry-url: 'https://registry.npmjs.org'
44+
- run: npm ci
45+
- run: npm publish
46+
env:
47+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
48+
- run: npm pack
49+
- uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2
50+
with:
51+
repo_token: ${{ secrets.GITHUB_TOKEN }}
52+
tag: ${{ needs.release.outputs.tag_name }}
53+
file: shaka-player-*.tgz
54+
file_glob: true
55+
overwrite: true
56+
57+
# TODO: Publish to appspot

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.git
33
.gitattributes
44
.gitignore
5+
.release-please*
56
*.pyc
67
docs/api/
78
coverage/

.release-please-config.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"last-release-sha": "c5faf244b30aa0a99af0e1a1bc7cb4340a1a9f91",
3+
"packages": {
4+
".": {
5+
"include-component-in-tag": false,
6+
"release-as": "3.4.0"
7+
}
8+
}
9+
}

.release-please-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.3.0"
3+
}

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Changelog
2+
13
## 3.3.1 (2022-01-28)
24

35
Bugfixes:

lib/player.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6536,7 +6536,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
65366536
* @define {string} A version number taken from git at compile time.
65376537
* @export
65386538
*/
6539-
shaka.Player.version = 'v3.4.0-pre-uncompiled';
6539+
shaka.Player.version = 'v3.4.0-pre-uncompiled'; // x-release-please-version
65406540

65416541
// Initialize the deprecation system using the version string we just set
65426542
// on the player.

0 commit comments

Comments
 (0)