Merge pull request #374 from THEOplayer/changeset-release/main #212
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Create app token | |
| uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.THEOPLAYER_BOT_APP_ID }} | |
| private-key: ${{ secrets.THEOPLAYER_BOT_PRIVATE_KEY }} | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Configure Git user | |
| run: | | |
| git config user.name 'theoplayer-bot[bot]' | |
| git config user.email '873105+theoplayer-bot[bot]@users.noreply.github.com' | |
| - name: Setup Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| - name: Setup npm 11 | |
| run: npm install -g npm@11.6.4 | |
| - name: Install dependencies | |
| run: npm ci --workspaces --include-workspace-root | |
| - name: Build | |
| run: npm run build | |
| - name: Create release PR or publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| commit: "Release" | |
| title: "Release" | |
| version: npm run changeset:version | |
| publish: npx changeset publish | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| # see https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868 | |
| NPM_TOKEN: '' | |
| NPM_CONFIG_PROVENANCE: true |