From 1e66aa742531635d4516ec10cd6e00ca412ebc44 Mon Sep 17 00:00:00 2001 From: Edouard Demotes Date: Mon, 20 Nov 2023 13:38:39 -0500 Subject: [PATCH] ci: merge publish and version --- .github/workflows/publish.yml | 24 ------------------- .../{release.yml => release-and-publish.yml} | 21 ++++++++++++++-- 2 files changed, 19 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/publish.yml rename .github/workflows/{release.yml => release-and-publish.yml} (55%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 8c2f3350..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Lerna publish - -on: - push: - branches: [ main ] - -jobs: - publish: - runs-on: ubuntu-latest - if: "contains(github.event.head_commit.message, 'chore(release): bump version')" - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GH_TOKEN }} - - name: Use Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org/' - - run: npm ci - - run: npm run build - - run: npm run lerna publish from-package - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release-and-publish.yml similarity index 55% rename from .github/workflows/release.yml rename to .github/workflows/release-and-publish.yml index b2e92ab0..fc602e01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-and-publish.yml @@ -1,11 +1,11 @@ -name: Lerna version +name: Lerna version & publish on: push: branches: [ main ] jobs: - publish: + release: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: @@ -26,3 +26,20 @@ jobs: - run: npm run test - run: npm run build - run: npm run lerna version + publish: + runs-on: ubuntu-latest + if: "contains(github.event.head_commit.message, 'chore(release): bump version')" + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org/' + - run: npm ci + - run: npm run build + - run: npm run lerna publish from-package + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}