Merge pull request #190 from CleverCloud/release-please--branches--ma… #11
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| - '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| publish: | |
| name: 'Publish' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: '[Prepare] Decode version from tag' | |
| id: version_regex | |
| uses: KyoriPowered/action-regex-match@v3 | |
| with: | |
| text: ${{ github.ref_name }} | |
| regex: '^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(beta)\.(?:0|[1-9]\d*))?$' | |
| - name: '[Prepare] Parse version' | |
| id: version_parse | |
| if: steps.version_regex.outputs.match != '' | |
| run: echo "prerelease=${{ steps.version_regex.outputs.group1 }}" >> $GITHUB_OUTPUT | |
| - name: '[Prepare] Extract NPM tag' | |
| id: npm_tag | |
| run: p=${{ steps.version_parse.outputs.prerelease }} && echo "tag=${p:-latest}" >> $GITHUB_OUTPUT | |
| - name: '[Prepare] Checkout' | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: '[Prepare] Setup Node.js' | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| - name: '[Prepare] Install dependencies' | |
| run: npm ci | |
| - name: '[Publish] version ${{ github.ref_name }} with tag ${{ steps.npm_tag.outputs.tag }}' | |
| run: | | |
| npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }} --provenance |