Merge pull request #19 from fintoc-com/main #8
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
name: release | |
on: | |
push: | |
branches: | |
- stable | |
jobs: | |
npm-release: | |
runs-on: ubuntu-latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js v14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
registry-url: https://registry.npmjs.org | |
# Cache the node_modules directory | |
- name: Set up node_modules cache | |
uses: actions/cache@v2 | |
id: node-modules-cache | |
with: | |
key: node-modules-cache-${{ hashFiles('**/package-lock.json') }} | |
path: '**/node_modules' | |
- name: Install dependencies | |
if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Build the package | |
run: npm run build | |
- name: Publish the package | |
run: npm publish | |
github-release: | |
needs: npm-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js v14 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
# Cache the node_modules directory | |
- name: Set up node_modules cache | |
uses: actions/cache@v2 | |
id: node-modules-cache | |
with: | |
key: node-modules-cache-${{ hashFiles('**/package-lock.json') }} | |
path: '**/node_modules' | |
- name: Install dependencies | |
if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Get version | |
id: version | |
run: echo ::set-output name=version::$(npm run --silent version:get) | |
- name: Get Pull Request data | |
uses: jwalton/gh-find-current-pr@v1 | |
id: find-pr | |
with: | |
state: all | |
- name: Tag and Release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
release_name: ${{ steps.version.outputs.version }} | |
body: | | |
${{ steps.find-pr.outputs.body }} | |
draft: false | |
prerelease: false |