joox-crypto/.github/workflows/build_and_publish.yml

34 lines
954 B
YAML
Raw Normal View History

2021-12-19 18:28:48 +00:00
name: Build and Publish
on: [push, pull_request]
jobs:
build_and_publish:
2021-12-19 18:34:46 +00:00
name: Build and Publish (on release)
2021-12-19 18:28:48 +00:00
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v2
- name: 🛠️ Configure Registry
uses: actions/setup-node@v2
with:
node-version: '16.x'
2021-12-19 20:49:02 +00:00
registry-url: 'https://registry.npmjs.org'
2021-12-19 18:28:48 +00:00
- name: 📦 Install Dependencies
run: npm ci
- name: 🧾 Test
run: npm test
- name: 🔥 Build Package
run: npm pack
- name: 💾 Archive Package built
uses: actions/upload-artifact@v2
with:
name: package
path: '*.tgz'
2021-12-19 18:28:48 +00:00
- name: 🚀 Publish Package
2021-12-19 20:51:09 +00:00
run: npm publish --access public
2021-12-19 18:28:48 +00:00
if: startsWith(github.ref, 'refs/tags/v')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}