Repository navigation
Release #47
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 | |
| on: workflow_dispatch | |
| jobs: | |
| release: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| NODE_AUTH_TOKEN: "" | |
| NPM_TOKEN: "" | |
| strategy: | |
| fail-fast: false | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: pnpm/action-setup@v3 | |
| name: Install pnpm | |
| id: pnpm-install | |
| with: | |
| version: '9' | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Build | |
| run: | | |
| pnpm build | |
| - name: Pack | |
| shell: bash | |
| run: | | |
| npm run pack | |
| - name: Run @arethetypeswrong/cli | |
| run: | | |
| pnpm attw package.tgz | |
| - name: Remove temp npmrc | |
| run: rm -f "$NPM_CONFIG_USERCONFIG" | |
| - name: Update NPM | |
| run: npm install -g npm@latest | |
| - name: Publish | |
| shell: bash | |
| run: | | |
| version="$(jq -r .version package.json)" | |
| echo "Publishing brocli@$version" | |
| npm publish package.tgz --provenance | |
| echo "npm: \`+ brocli@$version\`" >> $GITHUB_STEP_SUMMARY |