Skip to content

Commit

Permalink
ci(ship): enable shipjs integration
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenOutman committed Feb 10, 2022
1 parent ff47609 commit 838d47c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/nodejs-publish.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/weekly-release.yml
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 }}
4 changes: 4 additions & 0 deletions ship.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
pullRequestReviewers: ['simonguo', 'SevenOutman'],
publishCommand: () => 'npm publish lib'
};

0 comments on commit 838d47c

Please sign in to comment.