Skip to content

Commit 57ace57

Browse files
authored
build: ci/cd + automated dist updates (#41)
* build: ci/cd + automated dist updates * build: proper dist only on master * build: add ncc as a dev package * docs: add ncc build * build: add permissions for contents * refactor: remove duplicated/wrong names
1 parent e0c3770 commit 57ace57

File tree

5 files changed

+59
-5
lines changed

5 files changed

+59
-5
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: ci
2+
on: push
3+
4+
jobs:
5+
update:
6+
runs-on: ubuntu-22.04
7+
name: Node 16
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
12+
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 16
16+
cache: 'yarn'
17+
18+
- run: yarn install
19+
20+
- run: yarn build

.github/workflows/dist.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: dist
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
update:
9+
permissions:
10+
contents: write
11+
runs-on: ubuntu-22.04
12+
name: Commit Dist
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
21+
cache: 'yarn'
22+
23+
- run: yarn install
24+
25+
- run: yarn build
26+
27+
- name: Commit updated dist
28+
uses: stefanzweifel/git-auto-commit-action@v4
29+
with:
30+
commit_message: Update dist
31+
file_pattern: dist/

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ Store that in GitHub Secrets to securely pass to the action.
4444
```
4545
4646
## Development
47-
Make `ncc` available in your build environment:
48-
```shell
49-
npm i -g @vercel/ncc
50-
```
51-
5247
Install package dependencies:
5348
```shell
5449
yarn install

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
},
1616
"scripts": {
1717
"build": "ncc build index.js --source-map --license licenses.txt"
18+
},
19+
"devDependencies": {
20+
"@vercel/ncc": "^0.36.1"
1821
}
1922
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@
163163
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
164164
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
165165

166+
"@vercel/ncc@^0.36.1":
167+
version "0.36.1"
168+
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.36.1.tgz#d4c01fdbbe909d128d1bf11c7f8b5431654c5b95"
169+
integrity sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==
170+
166171
JSONStream@^1.3.4, JSONStream@^1.3.5:
167172
version "1.3.5"
168173
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"

0 commit comments

Comments
 (0)