Skip to content

Commit

Permalink
fix: when backporting we don't want to push latest docker tag (#7961) (
Browse files Browse the repository at this point in the history
…#7966)

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
  • Loading branch information
gastonfournier authored Aug 22, 2024
1 parent ca1a700 commit efd387a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/publish-new-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ concurrency:

permissions:
contents: write
id-token: write
id-token: write

on:
workflow_dispatch:
Expand All @@ -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
Expand All @@ -30,7 +30,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [ 20.x ]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -118,7 +118,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
Expand All @@ -134,7 +135,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:
Expand Down
24 changes: 5 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -93,13 +91,7 @@
"/frontend/",
"/website/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/dist/",
Expand Down Expand Up @@ -240,14 +232,8 @@
"tough-cookie": "4.1.4"
},
"lint-staged": {
"*.{js,ts}": [
"biome check --write --no-errors-on-unmatched"
],
"*.{jsx,tsx}": [
"biome check --write --no-errors-on-unmatched"
],
"*.json": [
"biome format --write --no-errors-on-unmatched"
]
"*.{js,ts}": ["biome check --write --no-errors-on-unmatched"],
"*.{jsx,tsx}": ["biome check --write --no-errors-on-unmatched"],
"*.json": ["biome format --write --no-errors-on-unmatched"]
}
}

0 comments on commit efd387a

Please sign in to comment.