Skip to content

Merge pull request #16 from alanpcs/dependabot/npm_and_yarn/micromatc… #37

Merge pull request #16 from alanpcs/dependabot/npm_and_yarn/micromatc…

Merge pull request #16 from alanpcs/dependabot/npm_and_yarn/micromatc… #37

Workflow file for this run

name: Publishes to NPM and Github packages
on:
push:
tags:
- "v*"
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js and set registry to github
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn build
- name: Parse version from git tag
run: |
git describe --tags --abbrev=0 | cut -d "v" -f 2 > VERSION
yarn version --new-version $(cat VERSION) --no-git-tag-version
- name: Publishes to Github packages
run: |
npm config set registry https://npm.pkg.github.com/alanpcs
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Publishes to NPM
run: |
npm config set registry https://registry.npmjs.org
sed -i 's/"@alanpcs\/redact-it"/"redact-it"/' package.json
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}