Skip to content

Commit 90d3baf

Browse files
tayeinteractjs-ci
authored andcommitted
chore(ci): use gh actions
1 parent fe36afc commit 90d3baf

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Workflow
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
test:
10+
name: '🧪 Test'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: ianwalter/playwright-container@43940dfa7d309fe3569b9df407ae9e84dcbf2e7f
15+
- name: ⚙ bootstrap
16+
run: 'npm run bootstrap && npx _check_deps && npx _add_plugin_indexes'
17+
- name: 📐 types
18+
run: npx tsc -b -f
19+
- name: 🔍 lint
20+
run: npx _lint
21+
- name: 🧪 tests
22+
run: npm test
23+
24+
publish-npm:
25+
name: '📦 Build and Publish 🚀'
26+
if: ${{ github.repository == 'taye/interact.js' && (github.ref_name == 'latest' || github.ref_name == 'next') }}
27+
needs: test
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: 16
34+
registry-url: https://registry.npmjs.org/
35+
cache: yarn
36+
- name: ⚙ bootstrap
37+
run: 'npm run bootstrap && git fetch --tags'
38+
- name: 📦 build and publish 🚀
39+
run: npx _release
40+
env:
41+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

scripts/bin/release.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ let packages
2020
main().catch(errorExit)
2121

2222
async function main (ps) {
23+
configGitUser()
2324
gitDetatch()
2425

2526
clean()
@@ -32,6 +33,11 @@ async function main (ps) {
3233
await pushAndPublish()
3334
}
3435

36+
function configGitUser () {
37+
shell.exec('git config user.name "CI"')
38+
shell.exec('git config user.email "<>"')
39+
}
40+
3541
function ensureCleanIndex () {
3642
// make sure the repo is clean
3743
try {

0 commit comments

Comments
 (0)