fix: trigger CI with hopefully correct build script state #43
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 Package to npm and Create GitHub Release | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write # Allow creation of releases and commits | |
| issues: write # Allow commenting on issues/PRs (optional) | |
| pull-requests: write # Allow commenting on issues/PRs (optional) | |
| packages: write # Allow publishing to GitHub Packages (if used alongside npm) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Essential for semantic-release to analyze history | |
| persist-credentials: false # Recommended practice | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| # Version is read from package.json's "packageManager" field | |
| # with: | |
| # version: 9 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm run build | |
| - name: List dist contents | |
| run: ls -lR dist | |
| # Optional: Add a test step here if you have tests | |
| # - name: Test | |
| # run: pnpm test | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Pack tarball locally for inspection | |
| run: pnpm pack --pack-destination ./ci-pack | |
| - name: List tarball contents | |
| run: tar -tvf ./ci-pack/*.tgz | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Use NPM_TOKEN as expected by @semantic-release/npm | |
| run: pnpm semantic-release |