diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..f9310b4b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: [push] + +jobs: + release: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + steps: + - uses: actions/checkout@v2 + + - name: Prepare repository + run: git fetch --unshallow --tags + + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - name: Cache node modules + uses: actions/cache@v1 + with: + path: node_modules + key: yarn-deps-${{ hashFiles('yarn.lock') }} + restore-keys: | + yarn-deps-${{ hashFiles('yarn.lock') }} + + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + yarn install --frozen-lockfile + yarn build + yarn release diff --git a/lerna.json b/lerna.json index d4fd743a..32cc3a12 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,11 @@ { "version": "0.3.0-next.0", "npmClient": "yarn", - "packages": [ - "packages/*" - ], - "useWorkspaces": true + "packages": ["packages/*"], + "useWorkspaces": true, + "command": { + "publish": { + "verifyAccess": false + } + } } diff --git a/package.json b/package.json index 2aa2a540..32de5dd2 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,20 @@ "watch": "lerna run --since HEAD --parallel x -- watch", "watch-package": "lerna run --scope @*/mini-frame --include-dependencies --parallel x -- watch", "watch-all": "lerna run --parallel x -- watch", - "storybook": "lerna run --scope storybook start --stream" + "storybook": "lerna run --scope storybook start --stream", + "release": "auto shipit" }, "devDependencies": { "auto": "^10.18.4", "lerna": "^4.0.0" + }, + "repository": "code-hike/codehike", + "author": "pomber ", + "auto": { + "plugins": [ + "npm", + "released" + ], + "onlyPublishWithReleaseLabel": false } } diff --git a/packages/script/build.js b/packages/script/build.js index d1cd5953..b4cfecad 100755 --- a/packages/script/build.js +++ b/packages/script/build.js @@ -9,8 +9,6 @@ function build(args) { "rollup.config.js" ) - // console.log({ configPath, cwd: process.cwd(), args: process.argv.slice(2) }); - spawn("yarn", ["rollup", "-c", configPath, ...args], { stdio: "inherit", // cwd: "foo"