chore: bump react template #104
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: '@nativescript/template-* -> npm' | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| env: | |
| NPM_TAG: 'next' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: npm-publish | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Update npm (required for OIDC trusted publishing) | |
| run: | | |
| npm install -g npm@^11.5.1 | |
| npm --version | |
| - name: Setup | |
| run: npm install | |
| - name: Prepare Templates | |
| run: npm run prepare-templates | |
| - name: Publish All Templates (OIDC trusted publishing) | |
| if: ${{ vars.USE_NPM_TOKEN != 'true' }} | |
| env: | |
| NODE_AUTH_TOKEN: "" | |
| run: | | |
| echo "Publishing templates to npm with tag $NPM_TAG via OIDC trusted publishing..." | |
| unset NODE_AUTH_TOKEN | |
| # Ensure we don't have token-based npm auth config lingering from setup-node | |
| rm -f ~/.npmrc | |
| if [ -n "${NPM_CONFIG_USERCONFIG:-}" ]; then | |
| rm -f "$NPM_CONFIG_USERCONFIG" | |
| unset NPM_CONFIG_USERCONFIG | |
| fi | |
| # run publish in every package; only ignore "already published" errors | |
| npx lerna exec --no-bail --stream --concurrency 1 -- "bash \"$GITHUB_WORKSPACE/.github/scripts/npm-publish-ci.sh\"" | |
| - name: Publish All Templates (granular token) | |
| if: ${{ vars.USE_NPM_TOKEN == 'true' }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
| run: | | |
| echo "Publishing templates to npm with tag $NPM_TAG via granular token..." | |
| # run publish in every package; only ignore "already published" errors | |
| npx lerna exec --no-bail --stream --concurrency 1 -- "bash \"$GITHUB_WORKSPACE/.github/scripts/npm-publish-ci.sh\"" |