Publish releases #9
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: Publish releases | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'The version number to tag and release' | |
| required: true | |
| type: string | |
| prerelease: | |
| description: 'Release as pre-release' | |
| required: false | |
| type: boolean | |
| default: false | |
| env: | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
| jobs: | |
| release-npm: | |
| runs-on: ubuntu-latest | |
| environment: main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm install npm -g | |
| - run: npm install | |
| - name: Change version number and sync | |
| run: | | |
| node scripts/update-version.mjs ${{ inputs.version }} | |
| - name: GIT commit and push all changed files | |
| run: | | |
| git config --global user.name "mcollina" | |
| git config --global user.email "hello@matteocollina.com" | |
| git commit -a -m "Bumped v${{ inputs.version }}" | |
| git push origin HEAD:${{ github.ref }} | |
| - run: npm publish --access public --tag ${{ inputs.prerelease == true && 'next' || 'latest' }} | |
| - name: 'Create release notes' | |
| run: | | |
| npx @matteo.collina/release-notes -a ${{ secrets.GITHUB_TOKEN }} -t v${{ inputs.version }} -r flame -o platformatic ${{ github.event.inputs.prerelease == 'true' && '-p' || '' }} -c ${{ github.ref }} |