Skip to content

Commit

Permalink
create separate publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Dec 14, 2024
1 parent bea87d5 commit 5d5ea46
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ on:
branches: [master]
pull_request:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
prepare:
Expand Down Expand Up @@ -180,27 +177,3 @@ jobs:

# - name: Run test
# run: npm test
publish:
# Allows you to run this job manually from the Actions tab
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 20.x

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Run lerna publish
run: npx lerna publish minor -y
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || '' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN || '' }}
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: publish

# Controls when the workflow will run
on:
push:
branches: [master]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 20.x

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Set up Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Etienne Rossignon (Sterfive)"
- name: Run lerna publish
run: npx lerna publish minor -y
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5d5ea46

Please sign in to comment.