Skip to content

Commit 68dd510

Browse files
author
Exeteres
committed
chore: Add automatic publishing workflow
1 parent 2309e67 commit 68dd510

File tree

4 files changed

+4519
-31
lines changed

4 files changed

+4519
-31
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
packages:
9+
runs-on: ubuntu-latest
10+
name: Publish packages
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: "14.x"
16+
17+
- uses: actions/cache@master
18+
with:
19+
path: |
20+
node_modules
21+
*/*/node_modules
22+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
23+
24+
- name: Install dependencies
25+
if: steps.cache.outputs.cache-hit != 'true'
26+
run: yarn
27+
28+
- name: Build packages
29+
run: yarn build
30+
31+
- name: Publish to NPM
32+
run: |
33+
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
34+
yarn publish-packages
35+
env:
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

lerna.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"version": "0.1.0",
3+
"npmClient": "yarn",
4+
"useWorkspaces": true
5+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
"license": "MIT",
66
"private": true,
77
"scripts": {
8-
"build-examples": "tstl"
8+
"build-examples": "tstl",
9+
"release": "lerna version --conventional-commits --create-release github",
10+
"publish-packages": "lerna publish from-git -y"
911
},
1012
"workspaces": [
1113
"packages/*"
1214
],
1315
"devDependencies": {
16+
"lerna": "^4.0.0",
1417
"lua-types": "^2.10.1",
1518
"typescript-to-lua": "^0.40.1"
1619
}

0 commit comments

Comments
 (0)