Skip to content

Merge pull request #16 from johnkraczek/main #12

Merge pull request #16 from johnkraczek/main

Merge pull request #16 from johnkraczek/main #12

Workflow file for this run

name: Release Build
on:
push:
tags:
- 'v*.*.*'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Release Version
id: getReleaseVersion
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/v}
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- name: Update NPM
run: npm install -g npm
- name: NPM Install
run: npm ci
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
name: bcrypt-edge-package
path: |
./dist
LICENSE
package.json
README.md
publish-package:
runs-on: ubuntu-latest
needs: build
steps:
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/
- name: Update NPM
run: npm install -g npm
- name: Download Schedulely artifact
uses: actions/download-artifact@v3
with:
name: bcrypt-edge-package
- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
## finalizing the release doesn't depend on Docs deploying because it fails frequently
finalize-release:
runs-on: ubuntu-latest
needs: publish-package
steps:
## Checkout so we can apply the new tag
- uses: actions/checkout@v3
with:
fetch-depth: '0'
## Documentation: https://github.com/marvinpinto/action-automatic-releases
- uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false