From ed1222f46748bd4de247cfd99cefb30dc1345711 Mon Sep 17 00:00:00 2001 From: Mehmet Ali Gok <33124154+mehmetaligok@users.noreply.github.com> Date: Tue, 23 May 2023 11:33:46 +0200 Subject: [PATCH] fix(go): go client tag duplication resolved (#1563) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🧭 What and Why We have created a new action on go client repo but we are also releasing a tag from this repo as well. So we have duplicate tags on the go client. This needs to be resolved. ### Changes included: * Action from generated client removed. * spreadGeneration.ts updated to release go tags with the `v` prefix. ## 🧪 Test Will be tested with the next release. --- .../.github/workflows/release.yml | 30 ------------------- scripts/ci/codegen/spreadGeneration.ts | 7 +++-- 2 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 clients/algoliasearch-client-go/.github/workflows/release.yml diff --git a/clients/algoliasearch-client-go/.github/workflows/release.yml b/clients/algoliasearch-client-go/.github/workflows/release.yml deleted file mode 100644 index eb9a32ff8c..0000000000 --- a/clients/algoliasearch-client-go/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release version - -on: - push: - branches: - - next - -jobs: - release: - name: Release tag - runs-on: ubuntu-20.04 - if: "startsWith(github.event.head_commit.message, 'chore: release')" - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - token: ${{ secrets.ALGOLIA_BOT_TOKEN }} - - name: Extract version - id: extract-version - run: | - version="v$(echo "${{ github.event.head_commit.message }}" | grep -oP 'release \K[\d.]+[-\w.]*')" - echo "Extracted version: $version" - echo "version=$version" >> $GITHUB_OUTPUT - - name: Create git tag - if: ${{ steps.extract-version.outputs.version != '' }} - run: | - git config --local user.email "accounts+algolia-api-client-bot@algolia.com" - git config --local user.name "algolia-bot" - git tag -a "${{ steps.extract-version.outputs.version }}" -m "Release $version" - git push origin "${{ steps.extract-version.outputs.version }}" diff --git a/scripts/ci/codegen/spreadGeneration.ts b/scripts/ci/codegen/spreadGeneration.ts index 3a4a70c1e0..9669bc2eb9 100644 --- a/scripts/ci/codegen/spreadGeneration.ts +++ b/scripts/ci/codegen/spreadGeneration.ts @@ -132,13 +132,16 @@ async function spreadGeneration(): Promise { // In case of a release commit, we also want to update tags on the clients repositories if (IS_RELEASE_COMMIT) { + // Go needs a 'v' prefix for tags. + const tagVersion = lang === 'go' ? `v${version}` : version; + console.log( `Processing release commit, creating new release tag ('${version}') for '${lang}' repository.` ); // we always want to delete the tag in case it exists - await run(`git tag -d ${version} || true`, { cwd: tempGitDir }); - await run(`git tag ${version} HEAD`, { cwd: tempGitDir }); + await run(`git tag -d ${tagVersion} || true`, { cwd: tempGitDir }); + await run(`git tag ${tagVersion} HEAD`, { cwd: tempGitDir }); await run('git push --tags', { cwd: tempGitDir }); }