forked from jordangarcia/nuclear-router
-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.15 KB
/
ci.yml
File metadata and controls
44 lines (41 loc) · 1.15 KB
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
## Draft pipeline, need to fix the NPM_TOKEN and NPM_REGISTRY_URL secrets in the repo settings.
name: CI
on:
push:
branches: [main, master]
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to publish (e.g., 1.0.0)'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 8.x
- run: yarn install
- run: yarn build
publish:
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 8.x
registry-url: ${{ secrets.NPM_REGISTRY_URL }}
- run: yarn install
- name: Set version
if: github.event_name == 'workflow_dispatch'
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version
- run: yarn build
- run: yarn publish --non-interactive
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}