From dd36f0f6d629d79a574fb2a74d5c8fb9c15baff4 Mon Sep 17 00:00:00 2001 From: WenheLI Date: Thu, 30 Jul 2020 09:36:12 +0800 Subject: [PATCH] feat: add nightly release (#378) --- .github/workflows/beta.yml | 61 ++++++++++++++++++++++++++++++++++++++ docs/meta/PROJECT_GUIDE.md | 18 +++++++++++ package.json | 3 +- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/beta.yml diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml new file mode 100644 index 000000000..55ce4dd4e --- /dev/null +++ b/.github/workflows/beta.yml @@ -0,0 +1,61 @@ +name: Beta Build Packages +on: + schedule: + - cron: '0 0 * * *' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Delete branch + uses: dawidd6/action-delete-branch@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branches: beta + + - name: Create Beta Branch + uses: peterjgrainger/action-create-branch@v1.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + branch: 'beta' + + - name: Checkout beta + uses: actions/checkout@v2 + with: + ref: beta + - name: Activity check + run: | + curl -sL https://api.github.com/repos/${{github.repository}}/commits?since=yesterday | jq -r '.[0]' > $HOME/commit.json + date="$(jq -r '.commit.committer.date' $HOME/commit.json)" + echo "Last commit is made @ $date" + + if [ -n "${date}" ]; then + echo ::set-env name=UPDATED::true + fi + shell: bash + + - name: Setup Node.js + uses: actions/setup-node@v1 + if: env.UPDATED == 'true' + with: + node-version: 12 + + - name: Install Dependencies + if: env.UPDATED == 'true' + run: | + npm install + npm run build + + - name: Publish npm beta packages + if: env.UPDATED == 'true' + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > ~/.npmrc + git config --global user.name 'pipcook' + git config --global user.email 'queyue.crk@alibaba-inc.com' + npm run beta-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NPM_AUTH_TOKEN: ${{ secrets.npm_token }} diff --git a/docs/meta/PROJECT_GUIDE.md b/docs/meta/PROJECT_GUIDE.md index ca042c5c8..d68d7019c 100644 --- a/docs/meta/PROJECT_GUIDE.md +++ b/docs/meta/PROJECT_GUIDE.md @@ -74,3 +74,21 @@ To help Pipcook discover all the plugins, the project provides some rules to let Community plugins can also be submitted as built-in plugins through pull requests, but this requires nomination by a core collaborator and the approvals of at least 2 collaborators. [semver]: https://semver.org/ + +### Beta Release + +The beta release will be built and published to npm every midnight if there is any commit in the past day. +The aim of having such a release is to provide a quick fix to existing bugs and access to new/experimental features that are not suitable to deploy under the production environment. + +#### Usage + +You can directly use the following command: +```bash +$ npm install @pipcook/pipcook-cli@beta -g +``` + +Or + +```bash +$ npm install --tag beta @pipcook/pipcook-cli -g +``` diff --git a/package.json b/package.json index be0867411..e47c0657b 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "test:pipeline": "sh ./run_pipeline.sh", "typedoc": "typedoc", "clean": "lerna run clean", - "release": "lerna publish from-package --yes --no-verify-access" + "release": "lerna publish from-package --yes --no-verify-access", + "beta-release": "lerna version prerelease --force-publish --yes && lerna publish --yes --no-verify-access --dist-tag beta" }, "dependencies": { "@types/jasmine": "^3.5.10",