Repository navigation
docs: add Windows build and run guide / and fix(postgres): resolve pg_dump/pg_restore path cross-platform #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
f94656a
02105a8
23678bf
461e92d
2052ab0
befec0d
0f6c93e
1615232
f022187
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| name: Build Windows release | ||
|
|
||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - '[0-9]+.[0-9]+.[0-9]+' | ||
| branches: | ||
| - main | ||
| - master | ||
|
|
||
| jobs: | ||
| build-windows: | ||
| runs-on: windows-latest | ||
|
Comment on lines
+4
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set explicit least-privilege workflow permissions. The workflow currently relies on default token permissions, which are broader than needed for a release build job. Add a 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disable credential persistence in checkout.
🧰 Tools🪛 zizmor (1.25.2)[warning] 17-18: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 18-18: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "windows-release.yml" -type fRepository: Portabase/agent Length of output: 99 🏁 Script executed: cat -n ./.github/workflows/windows-release.ymlRepository: Portabase/agent Length of output: 4256 🌐 Web query:
💡 Result: Pinning GitHub Actions to a full-length commit SHA is a critical security best practice designed to protect against supply chain attacks [1][2][3]. When you reference an action using a branch name or version tag (e.g., Citations:
Pin all Lines 18, 21, 77, 85, and 93 reference actions by version tag only (e.g., 🧰 Tools🪛 zizmor (1.25.2)[warning] 17-18: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 18-18: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| - name: Set up Rust toolchain (MSVC) | ||
| uses: actions-rs/toolchain@v1 | ||
|
RambokDev marked this conversation as resolved.
Resolved
|
||
| with: | ||
| toolchain: stable-x86_64-pc-windows-msvc | ||
| profile: minimal | ||
| override: true | ||
|
|
||
| - name: Install vcpkg and OpenSSL (x64) | ||
| shell: pwsh | ||
| run: | | ||
| # Install vcpkg and the prebuilt OpenSSL package | ||
| git clone https://github.com/microsoft/vcpkg C:\vcpkg | ||
| C:\vcpkg\bootstrap-vcpkg.bat | ||
| C:\vcpkg\vcpkg install openssl:x64-windows | ||
| # Export variables for subsequent steps | ||
| 'VCPKG_ROOT=C:\vcpkg' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
| 'OPENSSL_DIR=C:\vcpkg\installed\x64-windows' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
|
||
| - name: Build (cargo release) | ||
| shell: pwsh | ||
| env: | ||
| # Cargo / openssl-sys will pick up OPENSSL_DIR from the environment | ||
| OPENSSL_DIR: ${{ env.OPENSSL_DIR }} | ||
| run: | | ||
| # Ensure the environment variable is present for this step | ||
| if (-Not $env:OPENSSL_DIR) { Write-Host "OPENSSL_DIR not set, printing env for debugging"; Get-ChildItem Env: | ForEach-Object { Write-Host $_ } } | ||
| cargo build --release | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make artifact selection deterministic against the declared Rust bin target. Line 57 prefers Suggested fix- - name: Build (cargo release)
+ - name: Build (cargo release)
shell: pwsh
env:
# Cargo / openssl-sys will pick up OPENSSL_DIR from the environment
OPENSSL_DIR: ${{ env.OPENSSL_DIR }}
run: |
# Ensure the environment variable is present for this step
if (-Not $env:OPENSSL_DIR) { Write-Host "OPENSSL_DIR not set, printing env for debugging"; Get-ChildItem Env: | ForEach-Object { Write-Host $_ } }
- cargo build --release
+ cargo build --release --bin app
@@
- # Find the built executable. Prefer an explicit portabase-agent.exe, fall back to first exe in target/release
- $exe = "target\release\portabase-agent.exe"
- if (-not (Test-Path $exe)) {
- $first = Get-ChildItem -Path target\release -Filter *.exe | Select-Object -First 1
- if ($first) { $exe = $first.FullName }
- }
+ # Use the explicit release binary declared in Cargo.toml
+ $exe = "target\release\app.exe"Also applies to: 57-62 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Prepare artifact zip | ||
| id: prepare_artifact | ||
| shell: pwsh | ||
| env: | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| run: | | ||
| $tag = $env:RELEASE_TAG | ||
| if (-not $tag) { $tag = $env:GITHUB_SHA } | ||
|
|
||
| # Find the built executable. Prefer an explicit portabase-agent.exe, fall back to first exe in target/release | ||
| $exe = "target\release\portabase-agent.exe" | ||
| if (-not (Test-Path $exe)) { | ||
| $first = Get-ChildItem -Path target\release -Filter *.exe | Select-Object -First 1 | ||
| if ($first) { $exe = $first.FullName } | ||
| } | ||
|
|
||
| if (-not (Test-Path $exe)) { Write-Error "Built binary not found in target/release"; exit 1 } | ||
|
|
||
| $outDir = "artifact" | ||
| New-Item -ItemType Directory -Path $outDir -Force | Out-Null | ||
| Copy-Item -Path $exe -Destination $outDir\ | ||
|
|
||
| $zipName = "windows-release-$tag.zip" | ||
| if (Test-Path $zipName) { Remove-Item $zipName } | ||
| Compress-Archive -Path "$outDir\*" -DestinationPath $zipName -Force | ||
| Write-Host "ZIP=$zipName" | ||
| Write-Output "zip=$zipName" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | ||
|
|
||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-release | ||
| path: windows-release-*.zip | ||
|
|
||
| - name: Create GitHub Release | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| id: create_release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Upload release asset | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| uses: actions/upload-release-asset@v1 | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: windows-release-${{ github.ref_name }}.zip | ||
| asset_name: windows-release-${{ github.ref_name }}.zip | ||
| asset_content_type: application/zip | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,5 @@ | |
| .env | ||
|
|
||
| .claude | ||
| /docs | ||
|
|
||
| /docs | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [package] | ||
| name = "portabase-agent" | ||
| version = "1.12.1" | ||
| version = "1.12.2" | ||
| edition = "2024" | ||
|
|
||
| [dependencies] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| pub mod backup; | ||
| mod connection; | ||
| pub(crate) mod connection; | ||
| pub mod database; | ||
| mod format; | ||
| mod ping; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.