-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a0e855
commit 4a78ec1
Showing
8 changed files
with
294 additions
and
117 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
check-and-set-guid: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go environment | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' # You may change this to the latest Go version if needed | ||
|
||
- name: Check for GUIDs in wix.json | ||
id: check_guid | ||
shell: pwsh | ||
run: | | ||
$jsonFile = "./build/package/windows/wix.json" | ||
$wixJson = Get-Content $jsonFile | ConvertFrom-Json | ||
# Check if any GUID is empty | ||
$needsGuid = $false | ||
if ([string]::IsNullOrEmpty($wixJson.'upgrade-code') -or | ||
[string]::IsNullOrEmpty($wixJson.files.guid) -or | ||
[string]::IsNullOrEmpty($wixJson.env.guid)) { | ||
$needsGuid = $true | ||
} | ||
if ($needsGuid) { | ||
echo "GUIDs are missing. Setting GUIDs." | ||
echo "needs_guid=true" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
} else { | ||
echo "All GUIDs are set." | ||
echo "needs_guid=false" | Out-File -FilePath $env:GITHUB_ENV -Append | ||
} | ||
- name: Install go-msi and set GUIDs | ||
if: env.needs_guid == 'true' | ||
run: | | ||
go install github.com/wix-go/go-msi/cmd/go-msi@latest | ||
go-msi set-guid -p ./build/package/windows/wix.json | ||
- name: Commit and push changes | ||
if: env.needs_guid == 'true' | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add ./build/package/windows/wix.json | ||
git commit -m "Set GUIDs in wix.json" | ||
git push origin main | ||
shell: pwsh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"product": "pbs-d2d-backup", | ||
"company": "snry", | ||
"license": "LICENSE", | ||
"upgrade-code": "", | ||
"files": { | ||
"guid": "", | ||
"items": [ | ||
"pbs-d2d-backup.exe" | ||
] | ||
}, | ||
"directories": [], | ||
"env": { | ||
"guid": "", | ||
"vars": [ | ||
{ | ||
"name": "PATH", | ||
"value": "[INSTALLDIR]", | ||
"permanent": "no", | ||
"system": "no", | ||
"action": "set", | ||
"part": "last" | ||
} | ||
] | ||
}, | ||
"hooks": [ | ||
{"when": "install", "command": "sc.exe create PBSAgent binPath=\"[INSTALLDIR]pbs-d2d-backup.exe\" type=share start=auto DisplayName=\"PBS Agent\""}, | ||
{"when": "install", "command": "sc.exe start PBSAgent"}, | ||
{"when": "uninstall", "command": "sc.exe delete PBSAgent"} | ||
], | ||
"choco": { | ||
"description": "Orchestrating backups with Proxmox Backup Server", | ||
"project-url": "https://github.com/sonroyaalmerol/pbs-d2d-backup", | ||
"tags": "backup agent", | ||
"license-url": "https://github.com/sonroyaalmerol/pbs-d2d-backup/LICENSE" | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.