generated from PrismarineJS/prismarine-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (57 loc) · 1.59 KB
/
publish.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
63
64
65
66
name: npm-publish
on:
push:
branches:
- main
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout repository
uses: actions/checkout@v3
- id: setup_node
name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- id: install_deps
name: Install Dependencies
run: npm i
- id: build
name: Build
run: npm run build
- id: do_tests
name: Unit Tests
run: npm test
- id: publish_npm
name: Publish to NPM Registry
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
- id: edit_name
name: Namespace Package Name
uses: deef0000dragon1/json-edit-action@v1
env:
KEY: name
VALUE: "@pandapip1/mineflayer-swarm"
FILE: package.json
- id: publish_gh
name: Publish to GitHub Registry
uses: JS-DevTools/npm-publish@v1
with:
registry: https://npm.pkg.github.com
token: ${{ secrets.GITHUB_TOKEN }}
- id: create_release
name: Create Release
if: steps.publish_npm.outputs.type != 'none' && steps.publish_gh.outputs.type != 'none'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.publish_npm.outputs.version }}
release_name: Release ${{ steps.publish_npm.outputs.version }}
body: ${{ steps.publish_npm.outputs.version }}
draft: false
prerelease: false