From 673898a3e6caad9c9e56668fa8c3d47d0940f952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Wed, 29 Nov 2023 15:43:01 +0200 Subject: [PATCH 1/4] ci: use shared PR actions --- .github/workflows/create-pr-to-main.yml | 21 ++++++--------------- .github/workflows/sync-main-with-test.yml | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/sync-main-with-test.yml diff --git a/.github/workflows/create-pr-to-main.yml b/.github/workflows/create-pr-to-main.yml index 790c620c..321af97d 100644 --- a/.github/workflows/create-pr-to-main.yml +++ b/.github/workflows/create-pr-to-main.yml @@ -11,18 +11,9 @@ permissions: jobs: create-pr-to-main: - runs-on: ubuntu-latest - steps: - - name: Abort if it's not a pre-release - if: github.event.release.prerelease == false - run: exit 1 - - name: Checkout test branch - uses: actions/checkout@v3 - with: - ref: 'test' - - - name: Create Pull Request from tag branch to main - run: | - gh pr create --title "Release ${{ github.event.release.tag_name }}" --body "Release ${{ github.event.release.tag_name }}" --base main --head test --repo ${{ github.repository }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + name: Build project and run CI checks + uses: fingerprintjs/dx-team-toolkit/.github/workflows/create-pr.yml@v1 + with: + target_branch: test + tag_name: ${{ github.event.release.tag_name }} + prerelease: ${{ github.event.release.prerelease }} diff --git a/.github/workflows/sync-main-with-test.yml b/.github/workflows/sync-main-with-test.yml new file mode 100644 index 00000000..7bd890fa --- /dev/null +++ b/.github/workflows/sync-main-with-test.yml @@ -0,0 +1,18 @@ +name: Sync test with main + +on: + push: + branches: + - main + +permissions: + pull-requests: write + contents: read + +jobs: + sync-test-with-main: + name: Build project and run CI checks + uses: fingerprintjs/dx-team-toolkit/.github/workflows/create-pr.yml@v1 + with: + target_branch: main + prerelease: false From dbc75c42bb352c4243b2896f8c239de3a5ad4446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Wed, 29 Nov 2023 15:44:48 +0200 Subject: [PATCH 2/4] ci: use correct test for coverage --- .github/workflows/coverage-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml index 1745fcd5..c897d175 100644 --- a/.github/workflows/coverage-report.yml +++ b/.github/workflows/coverage-report.yml @@ -31,7 +31,7 @@ jobs: env: CI: true - name: Run test - run: yarn test + run: yarn test:coverage - name: Create Coverage Badges uses: jaywcjlove/coverage-badges-cli@e07f25709cd25486855c1ba1b26da53576ff3620 From 14f79f4cf17132641750ac3512906b9841d703f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Thu, 30 Nov 2023 10:54:05 +0200 Subject: [PATCH 3/4] ci: change release commit message --- .releaserc | 1 + 1 file changed, 1 insertion(+) diff --git a/.releaserc b/.releaserc index 77ae4c14..b2aa8ef0 100644 --- a/.releaserc +++ b/.releaserc @@ -116,6 +116,7 @@ [ "@semantic-release/git", { + "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}", "assets": [ "CHANGELOG.md", "package.json" From 80cb56fe93958ef2a53cdc3095c08a5169b6495e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Thu, 30 Nov 2023 13:31:05 +0200 Subject: [PATCH 4/4] ci: simplify pr action --- .../{create-pr-to-main.yml => create-pr.yml} | 12 ++++-------- .github/workflows/sync-main-with-test.yml | 18 ------------------ 2 files changed, 4 insertions(+), 26 deletions(-) rename .github/workflows/{create-pr-to-main.yml => create-pr.yml} (59%) delete mode 100644 .github/workflows/sync-main-with-test.yml diff --git a/.github/workflows/create-pr-to-main.yml b/.github/workflows/create-pr.yml similarity index 59% rename from .github/workflows/create-pr-to-main.yml rename to .github/workflows/create-pr.yml index 321af97d..2692bc1b 100644 --- a/.github/workflows/create-pr-to-main.yml +++ b/.github/workflows/create-pr.yml @@ -1,19 +1,15 @@ -name: Create PR to Main +name: Create PR on: release: types: - published -permissions: - pull-requests: write - contents: read - jobs: - create-pr-to-main: - name: Build project and run CI checks + create-pr: + name: Create PR uses: fingerprintjs/dx-team-toolkit/.github/workflows/create-pr.yml@v1 with: - target_branch: test + target_branch: ${{ github.event.release.prerelease && 'main' || 'test' }} tag_name: ${{ github.event.release.tag_name }} prerelease: ${{ github.event.release.prerelease }} diff --git a/.github/workflows/sync-main-with-test.yml b/.github/workflows/sync-main-with-test.yml deleted file mode 100644 index 7bd890fa..00000000 --- a/.github/workflows/sync-main-with-test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Sync test with main - -on: - push: - branches: - - main - -permissions: - pull-requests: write - contents: read - -jobs: - sync-test-with-main: - name: Build project and run CI checks - uses: fingerprintjs/dx-team-toolkit/.github/workflows/create-pr.yml@v1 - with: - target_branch: main - prerelease: false