From 5d5ea4615f84382fd1026c1254de499ea77582e2 Mon Sep 17 00:00:00 2001 From: Etienne Rossignon Date: Sat, 14 Dec 2024 21:28:03 +0100 Subject: [PATCH] create separate publish workflow --- .github/workflows/main.yml | 29 +--------------------------- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7fff268..a8109f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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: @@ -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/checkout@v4.2.2 - - - name: Set up Node.js - uses: actions/setup-node@v4.1.0 - 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 || '' }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..eafc879 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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/checkout@v4.2.2 + + - name: Set up Node.js + uses: actions/setup-node@v4.1.0 + 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 "etienne.rossignon@sterfive.com" + 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 }} +