v2.0.0 #13
Workflow file for this run
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 CLI to npm | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: packages/create-oss-store | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update CLI version to match release | |
| run: | | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION="${VERSION#v}" | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$CURRENT_VERSION" != "$VERSION" ]; then | |
| npm version "$VERSION" --no-git-tag-version | |
| else | |
| echo "Version already matches release: $VERSION" | |
| fi | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Publish to npm | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |