6 Commits

Author SHA1 Message Date
Fran Jurmanović
e259f2235a update deploy path cd
Some checks failed
Release and Deploy / build (push) Successful in 1m57s
Release and Deploy / deploy (push) Failing after 26s
2025-07-31 18:01:09 +02:00
Fran Jurmanović
e575f641c5 update migration script
Some checks failed
Release and Deploy / build (push) Successful in 1m59s
Release and Deploy / deploy (push) Failing after 15s
2025-07-31 17:56:11 +02:00
Fran Jurmanović
bb75a8c325 update release.yml
Some checks failed
Release and Deploy / build (push) Successful in 5m4s
Release and Deploy / deploy (push) Has been cancelled
2025-07-31 17:46:45 +02:00
Fran Jurmanović
99b1a2d1e9 CGO_ENABLED
Some checks failed
Release and Deploy / build (push) Failing after 1m34s
Release and Deploy / deploy (push) Has been skipped
2025-07-31 17:33:17 +02:00
Fran Jurmanović
a34b08072e update runner
Some checks failed
Release and Deploy / build (push) Failing after 6m38s
Release and Deploy / deploy (push) Has been skipped
2025-07-30 02:03:28 +02:00
Fran Jurmanović
8057420f09 Merge branch 'feature/add-delete-servers' 2025-07-30 01:59:31 +02:00

View File

@@ -8,13 +8,12 @@ env:
GO_VERSION: "1.21"
BINARY_NAME: "acc-server-manager"
MIGRATE_BINARY: "acc-server-migration"
API_BINARY: "api"
DEPLOY_PATH: 'C:\acc-server-manager'
SERVICE_NAME: "ACC Server Manager"
jobs:
build:
runs-on: windows-latest
runs-on: windows
steps:
- name: Checkout code
uses: actions/checkout@v3
@@ -27,35 +26,17 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: Run tests
env:
CGO_ENABLED: 1
run: go test -v ./...
- name: Build binaries
env:
CGO_ENABLED: 1
run: |
mkdir -p build
go build -v -o ./build/${{ env.BINARY_NAME }}.exe ./cmd/server
go build -v -o ./build/${{ env.MIGRATE_BINARY }}.exe ./cmd/migration
go build -v -o ./build/${{ env.API_BINARY }}.exe ./cmd/api
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/
asset_name: acc-server-manager-${{ github.ref_name }}.zip
asset_content_type: application/zip
go build -v -o ./build/${{ env.MIGRATE_BINARY }}.exe ./cmd/migrate
go build -v -o ./build/${{ env.BINARY_NAME }}.exe ./cmd/api
- name: Upload build artifacts
uses: actions/upload-artifact@v3
@@ -66,7 +47,7 @@ jobs:
deploy:
needs: build
runs-on: windows-latest
runs-on: windows
environment: production
steps:
- name: Download build artifacts
@@ -113,7 +94,8 @@ jobs:
# Run database migrations
Write-Host "Running database migrations..."
try {
& "${{ env.DEPLOY_PATH }}\${{ env.MIGRATE_BINARY }}.exe"
& cd "${{ env.DEPLOY_PATH }}"
& ".\${{ env.MIGRATE_BINARY }}.exe"
} catch {
Write-Warning "Migration failed: $_"
throw "Migration failed"