mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: safe-chain
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "lts/*"
|
|
registry-url: "https://registry.npmjs.org/"
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
|
|
- name: Set version number
|
|
id: get_version
|
|
run: |
|
|
version="${{ github.ref_name }}"
|
|
echo "tag=$version" >> $GITHUB_OUTPUT
|
|
|
|
- name: Add docs
|
|
run: |
|
|
cp ../README.md ./README.md
|
|
cp ../LICENSE ./LICENSE
|
|
cp -r ../docs ./docs
|
|
|
|
- name: Set the version
|
|
run: npm --no-git-tag-version version ${{ steps.get_version.outputs.tag }}
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Publish to npm
|
|
run: |
|
|
echo "Publishing version ${{ steps.get_version.outputs.tag }} to NPM"
|
|
npm publish --access public
|
|
env:
|
|
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|