This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Update changelog for CLI v0.0.106 #311
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upgrade Path Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| test-upgrade: | |
| name: Test CLI Upgrade Path | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [blacksmith-4vcpu-ubuntu-2204, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| if: ${{ matrix.os != 'blacksmith-4vcpu-ubuntu-2204' }} | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| - name: Set up Go | |
| uses: useblacksmith/setup-go@v6 | |
| if: ${{ matrix.os == 'blacksmith-4vcpu-ubuntu-2204' }} | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| - name: Build current version | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.os }}" == "windows-latest" ]; then | |
| go build -o agentuity-current.exe | |
| else | |
| go build -o agentuity-current | |
| fi | |
| # Simulate having an older version installed | |
| - name: Create simulated previous version | |
| shell: bash | |
| run: | | |
| # Instead of trying to download a previous release which might not exist, | |
| # we'll create a simulated "previous version" from the current build | |
| # Copy the current build as our "previous" version | |
| if [ "${{ matrix.os }}" == "windows-latest" ]; then | |
| # On Windows, executables have .exe extension | |
| cp agentuity-current.exe agentuity-previous.exe | |
| else | |
| # On Unix systems (Linux/macOS) | |
| cp agentuity-current agentuity-previous | |
| fi | |
| echo "Created simulated previous version" | |
| # Test the upgrade command | |
| - name: Test upgrade command | |
| shell: bash | |
| run: | | |
| # Create a directory structure to simulate installation | |
| mkdir -p test-upgrade | |
| # Copy the "previous" version to the test directory | |
| if [ "${{ matrix.os }}" == "windows-latest" ]; then | |
| cp agentuity-previous.exe test-upgrade/agentuity.exe | |
| else | |
| cp agentuity-previous test-upgrade/agentuity | |
| chmod +x test-upgrade/agentuity | |
| fi | |
| # Build the current version with a modified version string to simulate a newer version | |
| VERSION=$(./agentuity-current version) | |
| MAJOR=$(echo $VERSION | cut -d. -f1) | |
| MINOR=$(echo $VERSION | cut -d. -f2) | |
| PATCH=$(echo $VERSION | cut -d. -f3) | |
| NEW_PATCH=$((PATCH + 1)) | |
| NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" | |
| # Create a mock release with the new version | |
| mkdir -p mock-release | |
| go build -ldflags "-X main.version=$NEW_VERSION" -o mock-release/agentuity | |
| # Create checksums file | |
| cd mock-release | |
| if [ "${{ matrix.os }}" == "windows-latest" ]; then | |
| certutil -hashfile agentuity SHA256 | grep -v "hash of file" | grep -v "CertUtil" > checksums.txt | |
| else | |
| shasum -a 256 agentuity > checksums.txt | |
| fi | |
| cd .. | |
| # Test the upgrade command by mocking the GitHub API response | |
| # This is a simplified test - in a real scenario, you would need to mock the GitHub API | |
| # and set up a proper test environment | |
| echo "Testing upgrade command..." | |
| if [ "${{ matrix.os }}" == "windows-latest" ]; then | |
| ./test-upgrade/agentuity.exe version | |
| # On Windows, we would need a more complex setup to test the actual upgrade | |
| echo "Windows upgrade test completed (simplified)" | |
| else | |
| ./test-upgrade/agentuity version | |
| # On Unix systems, we can test more directly | |
| # In a real test, you would mock the GitHub API and test the actual upgrade | |
| echo "Unix upgrade test completed (simplified)" | |
| fi | |
| echo "Upgrade path test completed" |