From 4fb141e474a8b1e0a0fc17909d056678250ef951 Mon Sep 17 00:00:00 2001 From: omermorad Date: Wed, 1 Jan 2025 08:46:55 +0200 Subject: [PATCH] chore: fix e2e in publish packages workflow [skip ci] --- .github/workflows/publish-packages.yml | 42 +++++++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 1f38885a..cf250d4a 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -21,6 +21,14 @@ on: - 'beta' required: true default: 'dev' + release_branch: + description: 'Release Branch' + type: choice + options: + - 'next' + - 'master' + required: true + default: 'next' strategy: description: 'Release Strategy' type: choice @@ -37,7 +45,7 @@ jobs: strategy: matrix: e2e-project: ['jest/nestjs', 'sinon/nestjs', 'vitest/nestjs', 'jest/inversify', 'sinon/inversify', 'vitest/inversify'] - node-version: [16.x, 18.x, 20.x] + node-version: [16.x, 18.x, 20.x, 22.x] exclude: - e2e-project: 'vitest/inversify' node-version: '16.x' @@ -47,13 +55,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.target_branch }} + ref: ${{ inputs.release_branch }} - name: Remove Vitest If Needed if: ${{ matrix.node-version == '16.x' }} run: | rm -rf packages/doubles/vitest - git config --global user.email "ci@suites.dev" + git config --global user.email "e2e@suites.dev" git config --global user.name "Suites CI" git add . git commit -am "remove vitest temp" @@ -87,7 +95,7 @@ jobs: - name: Install jq run: sudo apt-get install jq - - name: Remove provenance from publishConfig + - name: Remove provenance from package.json files run: | find packages -name 'package.json' | while read filename; do jq 'del(.publishConfig.provenance)' "$filename" > temp.json && mv temp.json "$filename" @@ -97,20 +105,36 @@ jobs: run: | git config --global user.email "e2e@suites.dev" git config --global user.name "Suites e2e" + + - name: Commit Provenance Change + run: | git add . git commit -am "remove provenance" + - name: Version Packages + run: | + lerna version --yes \ + --no-changelog \ + --allow-branch ${{ inputs.release_branch }} \ + --no-git-tag-version \ + --no-push \ + --force-publish \ + --no-commit-hooks \ + --conventional-commits + + - name: Commit Packages Versions + run: | + git add . + git commit -am "bump versions" + - name: Publish Packages run: | yarn lerna publish from-package --yes \ --no-git-tag-version \ --no-push \ - --no-changelog \ - --no-commit-hooks \ --no-git-reset \ --exact \ - --force-publish \ - --dist-tag ci + --dist-tag e2e - name: Setup and Test run: | @@ -122,6 +146,8 @@ jobs: run: | rm -rf packages rm -rf node_modules + rm yarn.lock + rm package.json - name: Install Dependencies run: |