From e0069da5829eb30487119aa5cee1fd5eeb019d8b Mon Sep 17 00:00:00 2001 From: Saransh Saini <66969478+saranshsaini@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:54:27 -0800 Subject: [PATCH] Add Server version to Release (#146) * add * refactor --------- Co-authored-by: Saransh Saini --- .github/workflows/build-extension.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-extension.yml b/.github/workflows/build-extension.yml index 4f12a66..9c353ef 100644 --- a/.github/workflows/build-extension.yml +++ b/.github/workflows/build-extension.yml @@ -33,13 +33,30 @@ jobs: - name: Restore Packages run: nuget restore CodeiumVS.sln + - name: Set Release Condition + id: check_release + run: | + $isRelease = "${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/enterprise-release-v') && (github.actor == 'saranshsaini' || github.actor == 'fortenforge') }}" + echo "IS_RELEASE=$isRelease" | Out-File -FilePath $env:GITHUB_ENV -Append + if ($isRelease -eq 'true') { + $tag = "${{ github.ref_name }}" + $version = $tag -replace 'enterprise-release-v','' + echo "VSIX_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append + } + + - name: Update VSIX Version + if: env.IS_RELEASE == 'true' + run: | + $manifestPath = "CodeiumVS/source.extension.vsixmanifest" + $xml = [xml](Get-Content $manifestPath) + $xml.PackageManifest.Metadata.Identity.Version = "${{ env.VSIX_VERSION }}" + $xml.Save($manifestPath) + - name: Build Solution run: msbuild CodeiumVS.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TargetFrameworkVersion="v4.8" /restore - id: auth - if: | - (github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/enterprise-release-v')) && - (github.actor == 'saranshsaini' || github.actor == 'fortenforge') + if: env.IS_RELEASE == 'true' uses: google-github-actions/auth@v2 timeout-minutes: 1 with: @@ -47,9 +64,7 @@ jobs: service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} - name: Upload Codeium Visual Studio VSIX - if: | - (github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/enterprise-release-v')) && - (github.actor == 'saranshsaini' || github.actor == 'fortenforge') + if: env.IS_RELEASE == 'true' uses: google-github-actions/upload-cloud-storage@v2 with: path: CodeiumVS/bin/Release/Codeium.vsix