Publish new release #56
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: Publish new release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 18 * * 1 | |
jobs: | |
setup: | |
name: Setup repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup repository | |
uses: ./.github/actions/setup-repository | |
build: | |
name: Build and check types | |
runs-on: ubuntu-latest | |
needs: [ setup ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Run build script | |
uses: ./.github/actions/build | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: [ setup ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Lint the codebase | |
uses: ./.github/actions/lint | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
continue-on-error: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup repository | |
uses: ./.github/actions/setup-repository | |
- name: Run tests | |
run: npm test | |
publish_release: | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: [ build, test, lint ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup repository | |
uses: ./.github/actions/setup-repository | |
- name: Request PAT from private key | |
id: requestPAT | |
run: | | |
node privateKeyToPAT.js ${{ secrets.RELEASE_BOT_KEY_BASE64 }} >> $GITHUB_OUTPUT | |
- name: Create and publish a new release | |
run: npx semantic-release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN_MSGROOM }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_MSGROOM }} | |
GH_TOKEN: ${{ steps.requestPAT.outputs.PAT }} | |
- name: Generate a tarball from the build results | |
run: npm pack | |
- name: Upload the tarball as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: msgroom-*.tgz | |
name: after_release |