Repository navigation
Merge pull request #175 from xsolla/PAYMENTS-26501_3ds-fixes #91
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-please | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: release-please | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Run release-please (manifest) | |
| id: rp | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| # Publish to npm only if a release was created earlier | |
| - name: Checkout (release tag) | |
| if: steps.rp.outputs.release_created == 'true' | |
| uses: actions/checkout@v4 | |
| with: | |
| # release-please gives the exact tag name (e.g. v0.33.3 or 0.33.3) | |
| ref: ${{ steps.rp.outputs.tag_name }} | |
| - name: Setup Node.js 20 | |
| if: steps.rp.outputs.release_created == 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| - name: Install deps | |
| if: steps.rp.outputs.release_created == 'true' | |
| run: npm ci | |
| env: | |
| npm_config_registry: 'https://registry.npmjs.org' | |
| - name: Build (if script exists) | |
| if: steps.rp.outputs.release_created == 'true' | |
| run: | | |
| if npm run | grep -q "^ build$"; then | |
| npm run build | |
| else | |
| echo "No build script, skipping" | |
| fi | |
| - name: Sanity check - package.json version matches tag | |
| if: steps.rp.outputs.release_created == 'true' | |
| run: | | |
| PKG_VER=$(node -p "require('./package.json').version") | |
| TAG="${{ steps.rp.outputs.tag_name }}" | |
| TAG_TRIMMED="${TAG#v}" | |
| if [ "$PKG_VER" != "$TAG_TRIMMED" ]; then | |
| echo "package.json version ($PKG_VER) doesn't match tag ($TAG)" | |
| exit 1 | |
| fi | |
| - name: Publish to npm | |
| if: steps.rp.outputs.release_created == 'true' | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |