Skip to content

Commit

Permalink
feat: add nightly release (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenheLI authored Jul 30, 2020
1 parent ebf9a32 commit dd36f0f
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 '[email protected]'
npm run beta-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NPM_AUTH_TOKEN: ${{ secrets.npm_token }}
18 changes: 18 additions & 0 deletions docs/meta/PROJECT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit dd36f0f

Please sign in to comment.