From 05080e87752cca574e38c0cf64669b830622061e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Thu, 22 Aug 2024 12:17:11 +0200 Subject: [PATCH] fix: when backporting we don't want to push latest docker tag (#7961) (#7967) Backporting fixes to old versions usually pushes the docker latest tag as well. We only want to do this if the version we're releasing is the latest --- .github/workflows/docker_publish.yaml | 6 ++++++ .github/workflows/publish-new-version.yaml | 11 +++++----- package.json | 24 +++++----------------- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml index c9f74a8835..5f774cb6e1 100644 --- a/.github/workflows/docker_publish.yaml +++ b/.github/workflows/docker_publish.yaml @@ -12,6 +12,11 @@ on: description: "Which version to release" type: 'string' required: true + is-latest-version: + description: Is this the latest version? If latest we'll update the version docker + required: true + type: boolean + default: true workflow_dispatch: jobs: @@ -39,6 +44,7 @@ jobs: with: images: | unleashorg/unleash-server + flavor: latest=${{ github.event.inputs.is-latest-version }} tags: | # only enabled for workflow dispatch except main (assume its a release): type=semver,pattern={{ version }},enable=${{ github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' }},value=${{ inputs.version }} diff --git a/.github/workflows/publish-new-version.yaml b/.github/workflows/publish-new-version.yaml index 1f44f66d32..30355e1bfc 100644 --- a/.github/workflows/publish-new-version.yaml +++ b/.github/workflows/publish-new-version.yaml @@ -6,7 +6,7 @@ concurrency: permissions: contents: write - id-token: write + id-token: write on: workflow_dispatch: @@ -18,8 +18,8 @@ on: required: true type: boolean default: true - update-version-function: - description: Should we update the version function to use this version? + is-latest-version: + description: Is this the latest version? If latest we'll update the version function, docker and npm latest required: true type: boolean default: true @@ -116,7 +116,8 @@ jobs: secrets: inherit with: version: ${{ github.event.inputs.version }} - + is-latest-version: ${{ github.event.inputs.is-latest-version == 'true' }} + publish-npm: needs: build uses: ./.github/workflows/release.yaml @@ -132,7 +133,7 @@ jobs: update-version-checker: needs: publish-docker - if: ${{ github.event.inputs.update-version-function == 'true' }} + if: ${{ github.event.inputs.is-latest-version == 'true' }} uses: ./.github/workflows/update_version_for_version_checker.yml secrets: inherit with: diff --git a/package.json b/package.json index 630c728072..088b8a41a8 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"] } }