-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@comet/create-app: Automatic publishing (#66)
Publishes a minor release when merging a pull request with changes in `create-app/` into `main`.
- Loading branch information
1 parent
c18d691
commit d31e5c3
Showing
1 changed file
with
56 additions
and
0 deletions.
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,56 @@ | ||
name: Publish @comet/create-app | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
paths: | ||
- create-app/** | ||
|
||
jobs: | ||
publish: | ||
name: Publish @comet/create-app | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "${{ github.actor }}" | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.VIVID_PLANET_BOT_TOKEN }} | ||
- run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "npm" | ||
cache-dependency-path: "create-app/package-lock.json" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
working-directory: create-app/ | ||
|
||
- name: Build | ||
run: npm run build | ||
working-directory: create-app/ | ||
|
||
- name: Bump version | ||
run: echo "NEW_VERSION=$(npm --no-git-tag-version version minor)" >> $GITHUB_ENV | ||
working-directory: create-app/ | ||
|
||
- name: Commit package.json | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "@comet/create-app: Publish ${{ env.NEW_VERSION }}" | ||
|
||
- name: Publish release | ||
run: npm publish | ||
working-directory: create-app/ | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |