From 353257408e48f84f142a97596bb426d087160e35 Mon Sep 17 00:00:00 2001 From: Nimish Date: Wed, 11 Mar 2026 18:26:40 +0800 Subject: [PATCH 1/3] Release v2.0.0: Go CLI with raw exe download - Update manifest to download raw .exe instead of zip (no more Windows-binary dir) - Update URL to new naming convention: phase_cli_{version}_windows_amd64.exe - Add autoupdate hash extraction from checksums.txt - Add upgrade test CI job to verify 1.x -> 2.x upgrade path --- .github/workflows/cli-package-test.yml | 72 ++++++++++++++++++++++++++ phase.json | 16 +++--- 2 files changed, 82 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cli-package-test.yml b/.github/workflows/cli-package-test.yml index 3731247..2257e1e 100644 --- a/.github/workflows/cli-package-test.yml +++ b/.github/workflows/cli-package-test.yml @@ -35,3 +35,75 @@ jobs: throw "Version mismatch: Expected $expected, but found $actual" } shell: pwsh + + scoop-upgrade-test: + name: Upgrade test (Windows) + runs-on: windows-latest + if: github.event_name == 'pull_request' + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Scoop Package Manager + run: | + Set-ExecutionPolicy RemoteSigned -Scope CurrentUser + irm get.scoop.sh | iex + shell: pwsh + + - name: Add Scoop to PATH + run: echo "${env:USERPROFILE}\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + shell: pwsh + + - name: Install old version from published bucket + run: | + scoop bucket add phase-cli https://github.com/phasehq/scoop-cli.git + scoop install phase-cli/phase + $version = phase --version + Write-Host "Installed version: $version" + shell: pwsh + + - name: Verify old version is 1.x + run: | + $version = phase --version + if ($version -notmatch '^1\.') { + throw "Expected 1.x version, got: $version" + } + Write-Host "Old version confirmed: $version" + shell: pwsh + + - name: Upgrade to new version from PR + run: | + # Replace the manifest in the bucket and prevent git pull from overwriting it + $bucketPath = "$env:USERPROFILE\scoop\buckets\phase-cli" + Copy-Item "${{ github.workspace }}\phase.json" "$bucketPath\phase.json" -Force + + Push-Location $bucketPath + git remote remove origin + git add phase.json + git commit -m "Update to new version" + Pop-Location + + scoop update phase + shell: pwsh + + - name: Verify upgrade succeeded + run: | + $content = Get-Content ${{ github.workspace }}\phase.json | ConvertFrom-Json + $expected = $content.version + $actual = phase --version + Write-Host "Expected: $expected" + Write-Host "Actual: $actual" + if ($actual -ne $expected) { + throw "Version mismatch after upgrade: expected $expected, got $actual" + } + shell: pwsh + + - name: Verify old artifacts removed + run: | + $appDir = "$env:USERPROFILE\scoop\apps\phase\current" + if (Test-Path "$appDir\Windows-binary") { + throw "ERROR: Old Windows-binary directory still exists after upgrade" + } + Write-Host "Old artifacts properly cleaned up" + shell: pwsh diff --git a/phase.json b/phase.json index ebe0370..0be30a7 100644 --- a/phase.json +++ b/phase.json @@ -1,19 +1,23 @@ { - "version": "1.21.3", + "version": "2.0.0", "description": "Securely manage your secrets and environment variables with Phase.", "homepage": "https://github.com/phasehq/cli", "license": "GPLv3", - "url": "https://github.com/phasehq/cli/releases/download/v1.21.3/phase_cli_windows_amd64_1.21.3.zip", - "hash": "4f2acb80c11c8bf41d7812a8845768e697a9c3ea530629938f3e4eed026caba9", - "bin": "Windows-binary/phase/phase.exe", + "url": "https://github.com/phasehq/cli/releases/download/v2.0.0/phase_cli_2.0.0_windows_amd64.exe#/phase.exe", + "hash": "ab21bcf3c3412e0eefe7e9c156cb5a9b2b6cd46462584600f721a1250ae726ae", + "bin": "phase.exe", "shortcuts": [ - ["Windows-binary/phase/phase.exe", "Phase"] + ["phase.exe", "Phase"] ], "checkver": { "github": "phasehq/cli", "regex": "tag/v([\\d.]+)" }, "autoupdate": { - "url": "https://github.com/phasehq/cli/releases/download/v$version/phase_cli_windows_amd64_$version.zip" + "url": "https://github.com/phasehq/cli/releases/download/v$version/phase_cli_$version_windows_amd64.exe#/phase.exe", + "hash": { + "url": "https://github.com/phasehq/cli/releases/download/v$version/checksums.txt", + "regex": "([a-fA-F0-9]{64})\\s+phase_cli_$version_windows_amd64\\.exe" + } } } From c0e5298c2832aadcef787ecb605a8de69119bb29 Mon Sep 17 00:00:00 2001 From: Nimish Date: Wed, 11 Mar 2026 18:41:06 +0800 Subject: [PATCH 2/3] ci: trigger PR workflow From 292f1cf703d8d456092d75ae81eff65fb21d1dc3 Mon Sep 17 00:00:00 2001 From: Nimish Date: Wed, 11 Mar 2026 18:51:59 +0800 Subject: [PATCH 3/3] chore: remove one-time 1.x -> 2.x upgrade test job --- .github/workflows/cli-package-test.yml | 72 -------------------------- 1 file changed, 72 deletions(-) diff --git a/.github/workflows/cli-package-test.yml b/.github/workflows/cli-package-test.yml index 2257e1e..3731247 100644 --- a/.github/workflows/cli-package-test.yml +++ b/.github/workflows/cli-package-test.yml @@ -35,75 +35,3 @@ jobs: throw "Version mismatch: Expected $expected, but found $actual" } shell: pwsh - - scoop-upgrade-test: - name: Upgrade test (Windows) - runs-on: windows-latest - if: github.event_name == 'pull_request' - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Install Scoop Package Manager - run: | - Set-ExecutionPolicy RemoteSigned -Scope CurrentUser - irm get.scoop.sh | iex - shell: pwsh - - - name: Add Scoop to PATH - run: echo "${env:USERPROFILE}\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - shell: pwsh - - - name: Install old version from published bucket - run: | - scoop bucket add phase-cli https://github.com/phasehq/scoop-cli.git - scoop install phase-cli/phase - $version = phase --version - Write-Host "Installed version: $version" - shell: pwsh - - - name: Verify old version is 1.x - run: | - $version = phase --version - if ($version -notmatch '^1\.') { - throw "Expected 1.x version, got: $version" - } - Write-Host "Old version confirmed: $version" - shell: pwsh - - - name: Upgrade to new version from PR - run: | - # Replace the manifest in the bucket and prevent git pull from overwriting it - $bucketPath = "$env:USERPROFILE\scoop\buckets\phase-cli" - Copy-Item "${{ github.workspace }}\phase.json" "$bucketPath\phase.json" -Force - - Push-Location $bucketPath - git remote remove origin - git add phase.json - git commit -m "Update to new version" - Pop-Location - - scoop update phase - shell: pwsh - - - name: Verify upgrade succeeded - run: | - $content = Get-Content ${{ github.workspace }}\phase.json | ConvertFrom-Json - $expected = $content.version - $actual = phase --version - Write-Host "Expected: $expected" - Write-Host "Actual: $actual" - if ($actual -ne $expected) { - throw "Version mismatch after upgrade: expected $expected, got $actual" - } - shell: pwsh - - - name: Verify old artifacts removed - run: | - $appDir = "$env:USERPROFILE\scoop\apps\phase\current" - if (Test-Path "$appDir\Windows-binary") { - throw "ERROR: Old Windows-binary directory still exists after upgrade" - } - Write-Host "Old artifacts properly cleaned up" - shell: pwsh