v2.2.0 #35
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@v2 | |
- 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@v2 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
registry-url: 'https://npm.pkg.github.com/simondotm' | |
#scope: '@simondotm' | |
#- run: npm run addscope | |
- run: npm ci | |
- name: Build plugin | |
run: npx nx build nx-firebase | |
- name: Create package | |
run: npm pack | |
working-directory: ./dist/packages/nx-firebase | |
- name: Publish to GitHub Packages | |
run: npm publish | |
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@v2 | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- name: Build plugin | |
run: npx nx build nx-firebase | |
- name: Publish to NPM | |
run: npm publish --access=public | |
working-directory: ./dist/packages/nx-firebase | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |