Skip to content

Commit

Permalink
Add Server version to Release (#146)
Browse files Browse the repository at this point in the history
* add

* refactor

---------

Co-authored-by: Saransh Saini <[email protected]>
  • Loading branch information
saranshsaini and Saransh Saini authored Dec 6, 2024
1 parent 85f8400 commit e0069da
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,38 @@ 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:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
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
Expand Down

0 comments on commit e0069da

Please sign in to comment.