Skip to content

Commit 984f08d

Browse files
authored
Merge pull request #32 from code-hike/add-release-workflow
Add release workflow
2 parents 5af3995 + 323f72f commit 984f08d

File tree

4 files changed

+53
-7
lines changed

4 files changed

+53
-7
lines changed

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on: [push]
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Prepare repository
13+
run: git fetch --unshallow --tags
14+
15+
- name: Use Node.js 14.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14.x
19+
20+
- name: Cache node modules
21+
uses: actions/cache@v1
22+
with:
23+
path: node_modules
24+
key: yarn-deps-${{ hashFiles('yarn.lock') }}
25+
restore-keys: |
26+
yarn-deps-${{ hashFiles('yarn.lock') }}
27+
28+
- name: Create Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
run: |
33+
yarn install --frozen-lockfile
34+
yarn build
35+
yarn release

lerna.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"version": "0.3.0-next.0",
33
"npmClient": "yarn",
4-
"packages": [
5-
"packages/*"
6-
],
7-
"useWorkspaces": true
4+
"packages": ["packages/*"],
5+
"useWorkspaces": true,
6+
"command": {
7+
"publish": {
8+
"verifyAccess": false
9+
}
10+
}
811
}

package.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@
1111
"watch": "lerna run --since HEAD --parallel x -- watch",
1212
"watch-package": "lerna run --scope @*/mini-frame --include-dependencies --parallel x -- watch",
1313
"watch-all": "lerna run --parallel x -- watch",
14-
"storybook": "lerna run --scope storybook start --stream"
14+
"storybook": "lerna run --scope storybook start --stream",
15+
"release": "auto shipit"
1516
},
1617
"devDependencies": {
1718
"auto": "^10.18.4",
1819
"lerna": "^4.0.0"
20+
},
21+
"repository": "code-hike/codehike",
22+
"author": "pomber <pombopombopombo@gmail.com>",
23+
"auto": {
24+
"plugins": [
25+
"npm",
26+
"released"
27+
],
28+
"onlyPublishWithReleaseLabel": false
1929
}
2030
}

packages/script/build.js

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ function build(args) {
99
"rollup.config.js"
1010
)
1111

12-
// console.log({ configPath, cwd: process.cwd(), args: process.argv.slice(2) });
13-
1412
spawn("yarn", ["rollup", "-c", configPath, ...args], {
1513
stdio: "inherit",
1614
// cwd: "foo"

0 commit comments

Comments
 (0)