v2.3.0 #37
Workflow file for this run
This file contains 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
# Publish package to npm when a Github release is published | |
name: Publish | |
on: | |
release: | |
types: [released] | |
jobs: | |
verify_tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
PACKAGE_VERSION=$(node -p "require('./packages/nx-firebase/package.json').version") | |
echo "Tag version: $TAG_VERSION" | |
echo "Package version: $PACKAGE_VERSION" | |
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then | |
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)" | |
exit 1 | |
fi | |
shell: bash | |
publish_github: | |
needs: [verify_tag] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
registry-url: 'https://npm.pkg.github.com/simondotm' | |
#scope: '@simondotm' | |
#- run: npm run addscope | |
- run: pnpm install | |
- name: Build plugin | |
run: npx nx build nx-firebase | |
- name: Create package | |
run: pnpm pack | |
working-directory: ./dist/packages/nx-firebase | |
- name: Publish to GitHub Packages | |
run: pnpm publish --no-git-checks | |
working-directory: ./dist/packages/nx-firebase | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish_npm: | |
needs: [verify_tag] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
registry-url: 'https://registry.npmjs.org' | |
- run: pnpm install | |
- name: Build plugin | |
run: npx nx build nx-firebase | |
- name: Publish to NPM | |
run: pnpm publish --no-git-checks --access=public | |
working-directory: ./dist/packages/nx-firebase | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |