-
-
Notifications
You must be signed in to change notification settings - Fork 928
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
1 parent
ff47609
commit 838d47c
Showing
3 changed files
with
63 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
name: Weekly release | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- "Weekly release" | ||
branches: | ||
- 'main' | ||
- 'ci/ship' | ||
schedule: | ||
# Run at 18:00 UTC+8 every Thursday | ||
- cron: '0 10 * * 4' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
push: | ||
branches: | ||
- 'main' | ||
- 'ci/ship' | ||
|
||
jobs: | ||
prepare: | ||
name: 'Prepare release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Create release PR (dry) | ||
if: ${{ github.event_name == 'pull_request' && github.head_ref == 'ci/ship' }} | ||
run: npx shipjs prepare --dry-run | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create release PR | ||
if: ${{ github.event_name == 'schedule' && github.ref_name == 'main' }} | ||
run: npx shipjs prepare | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
trigger: | ||
name: 'Trigger release' | ||
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: 🚢 Ship release | ||
run: npx shipjs trigger | ||
env: | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
pullRequestReviewers: ['simonguo', 'SevenOutman'], | ||
publishCommand: () => 'npm publish lib' | ||
}; |