From 73d13a07c7174cb6e9f25ddd1d88b17457f98e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Tue, 4 Jun 2024 10:12:58 +0200 Subject: [PATCH] chore: improve release process (#7254) Use the tag created by the build action when running npm version, otherwise the checkout actions gets the HEAD of the commit that triggered the original workflow resulting in the usage of the previous version. Potentially in the future, instead of triggering the build manually we could consider using the tag as a trigger for the build process and then all the dependent workflows should work fine. It's good we have this manual for validation, and we workaround some of the limitations before we invest more into more automation --- .github/workflows/docker_publish.yaml | 6 ++++++ .github/workflows/release.yaml | 2 ++ .github/workflows/release_changelog.yml | 2 ++ package.json | 24 +++++------------------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml index 2b0e915fc4..c9f74a8835 100644 --- a/.github/workflows/docker_publish.yaml +++ b/.github/workflows/docker_publish.yaml @@ -21,7 +21,13 @@ jobs: matrix: version: [18.18.2-alpine] steps: + - name: Checkout tag v${{ inputs.version }} + if: ${{ inputs.version != '' }} + uses: actions/checkout@v4 + with: + ref: v${{ inputs.version }} # tag that should be created by the caller workflow - name: Checkout + if: ${{ inputs.version == '' }} uses: actions/checkout@v4 - name: Setup QEmu so we can build multiplatform uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ecaa0963a9..d9ebad75da 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: v${{ inputs.version }} # tag that should be created by the caller workflow - name: Setup to npm uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release_changelog.yml b/.github/workflows/release_changelog.yml index ac4f6a2936..b1b7ee0f6d 100644 --- a/.github/workflows/release_changelog.yml +++ b/.github/workflows/release_changelog.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: v${{ inputs.version }} # tag that should be created by the caller workflow - name: Build changelog id: github_release uses: metcalfc/changelog-generator@v4.3.1 diff --git a/package.json b/package.json index 02a36fe4e4..42f9ff2854 100644 --- a/package.json +++ b/package.json @@ -82,9 +82,7 @@ "testTimeout": 10000, "globalSetup": "./scripts/jest-setup.js", "transform": { - "^.+\\.tsx?$": [ - "@swc/jest" - ] + "^.+\\.tsx?$": ["@swc/jest"] }, "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", "testPathIgnorePatterns": [ @@ -93,13 +91,7 @@ "/frontend/", "/website/" ], - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "jsx", - "json" - ], + "moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"], "coveragePathIgnorePatterns": [ "/node_modules/", "/dist/", @@ -237,14 +229,8 @@ "tough-cookie": "4.1.3" }, "lint-staged": { - "*.{js,ts}": [ - "biome check --apply --no-errors-on-unmatched" - ], - "*.{jsx,tsx}": [ - "biome check --apply --no-errors-on-unmatched" - ], - "*.json": [ - "biome format --write --no-errors-on-unmatched" - ] + "*.{js,ts}": ["biome check --apply --no-errors-on-unmatched"], + "*.{jsx,tsx}": ["biome check --apply --no-errors-on-unmatched"], + "*.json": ["biome format --write --no-errors-on-unmatched"] } }