Release 0.15.0 #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Finish Release Train | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
env: | |
LC_ALL: en_US.UTF-8 | |
LANG: en_US.UTF-8 | |
concurrency: | |
group: finish-release-train-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
create_pr: | |
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/v') | |
runs-on: ubuntu-latest | |
outputs: | |
version_number: ${{ steps.version_number.outputs.version_number }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Detect version number | |
id: version_number | |
run: | | |
version_number="$(jq --raw-output '.version' package.json)" | |
echo "Detected version number: $version_number" | |
echo "version_number=$version_number" >> $GITHUB_OUTPUT | |
- name: Create PR | |
run: | | |
gh pr create \ | |
--base "development" \ | |
--head "main" \ | |
--title "Finish release ${{ steps.version_number.outputs.version_number }}" \ | |
--body "Finish release ${{ steps.version_number.outputs.version_number }}" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
publish_release: | |
needs: [create_pr] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Git User | |
run: | | |
# setup git | |
git config --global user.name "Bitmovin Release Automation" | |
git config --global user.email "[email protected]" | |
- name: Add tag | |
run: | | |
git tag v${{ needs.create_pr.outputs.version_number }} | |
- name: Git push | |
run: | | |
git push origin v${{ needs.create_pr.outputs.version_number }} | |
- name: Setup node and npm registry | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org/' | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build TypeScript files | |
run: yarn build | |
- name: Publish npm package | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Extract changelog | |
id: changelog | |
uses: ffurrer2/extract-release-notes@v1 | |
- name: Create GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: v${{ needs.create_pr.outputs.version_number }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: ${{ steps.changelog.outputs.release_notes }} | |
publish_documentation: | |
needs: [publish_release] | |
name: Generate API Documentation | |
uses: ./.github/workflows/generate-documentation.yml | |
secrets: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
GCS_ACCOUNT: ${{ secrets.GCS_ACCOUNT }} | |
CF_TOKEN: ${{ secrets.CF_TOKEN }} | |
CF_ZONEID: ${{ secrets.CF_ZONEID }} |