|
| 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 |
0 commit comments