Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/v10-deployment-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,36 +67,50 @@ jobs:
- name: Check out code into the right branch
uses: actions/checkout@v4

- name: Build Linux Agent
- name: Build Linux Binaries (Agent & Updater)
env:
GOOS: linux
GOARCH: amd64
run: |
cd ${{ github.workspace }}/agent
go build -o utmstack_agent_service -v -ldflags "-X 'github.com/utmstack/UTMStack/agent/config.REPLACE_KEY=${{ secrets.AGENT_SECRET_PREFIX }}'" .

- name: Build Windows Agent (amd64)
cd ${{ github.workspace }}/agent/updater
go build -o utmstack_updater_service .

- name: Build Windows Binaries (amd64)
env:
GOOS: windows
GOARCH: amd64
run: |
cd ${{ github.workspace }}/agent
go build -o utmstack_agent_service.exe -v -ldflags "-X 'github.com/utmstack/UTMStack/agent/config.REPLACE_KEY=${{ secrets.AGENT_SECRET_PREFIX }}'" .

- name: Build Windows Agent (arm64)
cd ${{ github.workspace }}/agent/updater
go build -o utmstack_updater_service.exe .

- name: Build Windows Binaries (arm64)
env:
GOOS: windows
GOARCH: arm64
run: |
cd ${{ github.workspace }}/agent
go build -o utmstack_agent_service_arm64.exe -v -ldflags "-X 'github.com/utmstack/UTMStack/agent/config.REPLACE_KEY=${{ secrets.AGENT_SECRET_PREFIX }}'" .

cd ${{ github.workspace }}/agent/updater
go build -o utmstack_updater_service_arm64.exe .

- name: Sign Windows Agents
run: |
cd ${{ github.workspace }}/agent
signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f "${{ vars.SIGN_CERT }}" /csp "eToken Base Cryptographic Provider" /k "[{{${{ secrets.SIGN_KEY }}}}]=${{ secrets.SIGN_CONTAINER }}" "utmstack_agent_service.exe"
signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f "${{ vars.SIGN_CERT }}" /csp "eToken Base Cryptographic Provider" /k "[{{${{ secrets.SIGN_KEY }}}}]=${{ secrets.SIGN_CONTAINER }}" "utmstack_agent_service_arm64.exe"

cd ${{ github.workspace }}/agent/updater
signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f "${{ vars.SIGN_CERT }}" /csp "eToken Base Cryptographic Provider" /k "[{{${{ secrets.SIGN_KEY }}}}]=${{ secrets.SIGN_CONTAINER }}" "utmstack_updater_service.exe"
signtool sign /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 /f "${{ vars.SIGN_CERT }}" /csp "eToken Base Cryptographic Provider" /k "[{{${{ secrets.SIGN_KEY }}}}]=${{ secrets.SIGN_CONTAINER }}" "utmstack_updater_service_arm64.exe"


- name: Upload signed binaries as artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -105,6 +119,9 @@ jobs:
${{ github.workspace }}/agent/utmstack_agent_service
${{ github.workspace }}/agent/utmstack_agent_service.exe
${{ github.workspace }}/agent/utmstack_agent_service_arm64.exe
${{ github.workspace }}/agent/updater/utmstack_updater_service
${{ github.workspace }}/agent/updater/utmstack_updater_service.exe
${{ github.workspace }}/agent/updater/utmstack_updater_service_arm64.exe
retention-days: 1

build_agent_manager:
Expand Down Expand Up @@ -140,6 +157,10 @@ jobs:
cp "${{ github.workspace }}/agent/utmstack_agent_service.exe" ./dependencies/agent/
cp "${{ github.workspace }}/agent/utmstack_agent_service_arm64.exe" ./dependencies/agent/
cp "${{ github.workspace }}/agent/version.json" ./dependencies/agent/

cp "${{ github.workspace }}/agent/updater/utmstack_updater_service" ./dependencies/agent/
cp "${{ github.workspace }}/agent/updater/utmstack_updater_service.exe" ./dependencies/agent/
cp "${{ github.workspace }}/agent/updater/utmstack_updater_service_arm64.exe" ./dependencies/agent/

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
5 changes: 4 additions & 1 deletion agent/config/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ type ProtoPort struct {
TCP string
}

const (
SERVICE_UPDATER_NAME = "UTMStackUpdater"
)

var (
REPLACE_KEY string

Expand Down Expand Up @@ -41,7 +45,6 @@ var (
IntegrationKeyPath = filepath.Join(utils.GetMyPath(), "certs", "integration.key")
IntegrationCAPath = filepath.Join(utils.GetMyPath(), "certs", "integration-ca.crt")


// MaxConnectionTime = 120 * time.Second
// SERV_NAME = "UTMStackAgent"
// SERV_LOG = "utmstack_agent.log"
Expand Down
2 changes: 1 addition & 1 deletion agent/config/linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package config

var (
UpdaterSelf = "utmstack_updater_self%s"
ServiceFile = "utmstack_agent_service%s"
UpdaterFile = "utmstack_updater_service%s"
DependFiles = []string{"utmstack_agent_dependencies_linux.zip"}
)
2 changes: 1 addition & 1 deletion agent/config/linux_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package config

var (
UpdaterSelf = "utmstack_updater_self_arm64%s"
ServiceFile = "utmstack_agent_service_arm64%s"
UpdaterFile = "utmstack_updater_service_arm64%s"
DependFiles = []string{"utmstack_agent_dependencies_linux_arm64.zip"}
)
2 changes: 1 addition & 1 deletion agent/config/macos.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package config

var (
UpdaterSelf = "utmstack_updater_self%s"
ServiceFile = "utmstack_agent_service%s"
UpdaterFile = "utmstack_updater_service%s"
DependFiles = []string{}
)
2 changes: 1 addition & 1 deletion agent/config/windows_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package config

var (
UpdaterSelf = "utmstack_updater_self%s.exe"
ServiceFile = "utmstack_agent_service%s.exe"
UpdaterFile = "utmstack_updater_service%s.exe"
DependFiles = []string{"utmstack_agent_dependencies_windows.zip"}
)
2 changes: 1 addition & 1 deletion agent/config/windows_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package config

var (
UpdaterSelf = "utmstack_updater_self_arm64%s.exe"
ServiceFile = "utmstack_agent_service_arm64%s.exe"
UpdaterFile = "utmstack_updater_service_arm64%s.exe"
DependFiles = []string{"utmstack_agent_dependencies_windows_arm64.zip"}
)
1 change: 0 additions & 1 deletion agent/logs/utmstack_agent.log

This file was deleted.

3 changes: 2 additions & 1 deletion agent/models/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package models

type Version struct {
Version string `json:"version"`
Version string `json:"version"`
UpdaterVersion string `json:"updater_version"`
}
6 changes: 0 additions & 6 deletions agent/self/config/const.go

This file was deleted.

39 changes: 0 additions & 39 deletions agent/self/go.mod

This file was deleted.

94 changes: 0 additions & 94 deletions agent/self/go.sum

This file was deleted.

41 changes: 0 additions & 41 deletions agent/self/main.go

This file was deleted.

28 changes: 0 additions & 28 deletions agent/self/update/update.go

This file was deleted.

15 changes: 0 additions & 15 deletions agent/self/utils/files.go

This file was deleted.

Loading
Loading