feat: Add Spiritual Voucher Prompt Generator with Gemini AI integration #34
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 to npm | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build library | |
| run: npm run build:lib | |
| - name: Verify package version matches tag | |
| run: | | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
| if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Error: package.json version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Publish to npm | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Get tag message | |
| id: tag_message | |
| run: | | |
| TAG_MESSAGE=$(git tag -l --format='%(contents)' ${GITHUB_REF#refs/tags/}) | |
| echo "message<<EOF" >> $GITHUB_OUTPUT | |
| echo "$TAG_MESSAGE" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: ${{ steps.tag_message.outputs.message }} | |
| generate_release_notes: ${{ steps.tag_message.outputs.message == '' }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-') }} |