-
Notifications
You must be signed in to change notification settings - Fork 11
62 lines (51 loc) · 1.79 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This is a basic workflow to help you get started with Actions
name: Release
permissions:
contents: write
# Controls when the workflow will run
on:
# Triggers the workflow on push only for the "main" branch
push:
branches:
- 'main'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: Deploy
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: Get name & version from package.json
shell: bash
run: |
echo "name=$(node -p -e '`${require("./package.json").name}`')" >> $GITHUB_OUTPUT
echo "version=$(node -p -e '`${require("./lerna.json").version}`')" >> $GITHUB_OUTPUT
id: package_json
- name: Set the value
run: |
echo "pkg_name=${{ steps.package_json.outputs.name }}" >> $GITHUB_ENV
echo "pkg_version=${{ steps.package_json.outputs.version }}" >> $GITHUB_ENV
# Publish to npm registry
- name: Publish to NPM
run: npm run publish:latest
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_TOKEN }}
- name: GitHub Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: v${{ env.pkg_version }}
body_path: ./CHANGELOG.md