ensure we commit the lockfile #4
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: | |
| push: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [24] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm test | |
| - name: Resolve release metadata | |
| run: | | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| echo "RELEASE_KIND=release" >> $GITHUB_ENV | |
| echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV | |
| else | |
| echo "RELEASE_KIND=insiders" >> $GITHUB_ENV | |
| echo "INSIDERS_VERSION=0.0.0-insiders.$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| echo "RELEASE_CHANNEL=insiders" >> $GITHUB_ENV | |
| fi | |
| - name: Version based on commit | |
| if: env.RELEASE_KIND == 'insiders' | |
| run: npm version "$INSIDERS_VERSION" --force --no-git-tag-version | |
| - name: Publish | |
| run: npm publish --provenance --tag "$RELEASE_CHANNEL" |