Skip to content

Commit c064928

Browse files
committed
add 'auto' npm package and github cicd release pipeline
1 parent 727024a commit c064928

File tree

3 files changed

+957
-53
lines changed

3 files changed

+957
-53
lines changed

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
name: ⚡️ Vitest
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: ⬇️ Checkout repo
11+
uses: actions/checkout@v4
12+
13+
- name: 📦 Install dependencies
14+
run: yarn install --frozen-lockfile
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: ⚡️ Run vitest
19+
run: yarn workspaces run test
20+
21+
release:
22+
name: 📤 Release
23+
runs-on: ubuntu-latest
24+
needs: [test]
25+
permissions:
26+
packages: write
27+
contents: write
28+
pull-requests: write
29+
issues: write
30+
if:
31+
"!contains(github.event.head_commit.message, 'ci skip') &&
32+
!contains(github.event.head_commit.message, 'skip ci')"
33+
steps:
34+
- name: ⬇️ Checkout repository
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
- name: ⎔ Setup node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version-file: '.nvmrc'
43+
cache: 'yarn'
44+
registry-url: 'https://npm.pkg.github.com'
45+
scope: '@swan-bitcoin'
46+
env:
47+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: 📦 Install dependencies
51+
run: yarn install --frozen-lockfile
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: 📤 Release the kraken!
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
PROTECTED_BRANCH_REVIEWER_TOKEN:
60+
${{ secrets.PROTECTED_BRANCH_REVIEWER_TOKEN }}
61+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
62+
run: |
63+
yarn workspaces run compile
64+
yarn workspaces run release

packages/xpub-lib/package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"compile:watch": "babel --watch -d lib/ src/",
4444
"pretest": "yarn run compile",
4545
"prepublish": "yarn run compile",
46+
"release": "auto shipit",
4647
"test": "jest lib",
4748
"test:watch": "jest --watch src",
4849
"build:docs": "jsdoc *",
@@ -55,9 +56,18 @@
5556
"@babel/core": "^7.11.6",
5657
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
5758
"@babel/preset-env": "^7.11.5",
59+
"auto": "^11.3.0",
5860
"babel-jest": "^26.3.0",
5961
"jest": "^26.4.2",
6062
"livereload": "^0.9.1",
6163
"nodemon": "^2.0.4"
64+
},
65+
"auto": {
66+
"plugins": [
67+
"npm",
68+
"all-contributors",
69+
"conventional-commits",
70+
"first-time-contributor"
71+
]
6272
}
63-
}
73+
}

0 commit comments

Comments
 (0)