-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WenheLI
authored
Jul 30, 2020
1 parent
ebf9a32
commit dd36f0f
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters