Skip to content

@comet/create-app: Automatic publishing #2

@comet/create-app: Automatic publishing

@comet/create-app: Automatic publishing #2

name: CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./create-app
steps:
- run: echo "${{ github.actor }}"
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
# token: ${{ secrets.VIVID_PLANET_BOT_TOKEN }}
- run: |
git config user.name github-actions
git config user.email [email protected]
- 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
- name: Build
run: npm run build
- name: Bump version
if: |
github.base_ref == 'main' &&
github.event.pull_request.merged == true
run: echo "NEW_VERSION=$(npm --no-git-tag-version version minor)" >> $GITHUB_ENV
- name: "Test"
run: echo "Would publish ${{ env.NEW_VERSION }}"
# - name: Commit package.json
# if: |
# github.base_ref == 'main' &&
# github.event.pull_request.merged == true
# uses: EndBug/add-and-commit@v9
# with:
# message: Publish ${{ env.NEW_VERSION }}
# - name: Publish release
# if: |
# github.base_ref == 'main' &&
# github.event.pull_request.merged == true
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}