Merge pull request #33 from bruceharrison1984/fix-all-builds #26
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
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@v4 | |
- 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@v4 | |
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: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4.4.0 | |
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@v4 | |
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@v4.1.8 | |
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@v4 | |
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 |