π Release by iamyoki #21
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 | |
| run-name: π Release by ${{ github.actor }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - docs/** | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: fregante/setup-git-user@v2 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "@iamyoki" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Cache lints | |
| id: cache-lints | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .eslintcache | |
| key: ${{ runner.os }}-lints-${{ hashFiles('pnpm*', 'eslint.config.*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-lints- | |
| - name: Lint | |
| run: pnpm lint | |
| # - name: Type check | |
| # run: pnpm typecheck | |
| - name: Test | |
| run: pnpm test | |
| - name: Build | |
| run: pnpm build | |
| - name: Pack | |
| run: pnpm pack | |
| - name: Print Environment Info | |
| run: npx nx report | |
| shell: bash | |
| - name: Release | |
| run: npx nx release --skip-publish | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to github packages | |
| run: | | |
| pnpm pkg set name=@iamyoki/committier | |
| npx nx release publish | |
| pnpm pkg set name=committier | |
| shell: bash | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to npm packages | |
| run: | | |
| pnpm pkg set name=committier | |
| pnpm publish --provenance --access public --registry https://registry.npmjs.org/ | |
| shell: bash | |
| continue-on-error: true | |
| env: | |
| NPM_CONFIG_PROVENANCE: true | |
| - name: Get tag | |
| id: tag | |
| run: | | |
| TAG_NAME=$(git tag --sort=v:refname | tail -1) | |
| echo TAG_NAME=$TAG_NAME >> $GITHUB_OUTPUT | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{ steps.tag.outputs.TAG_NAME }} | |
| with: | |
| tag_name: ${{ steps.tag.outputs.TAG_NAME }} | |
| files: "*.tgz" | |
| overwrite_files: false |