removed test data
Some checks failed
Build and Release Core / Test and Build (push) Has been cancelled
Some checks failed
Build and Release Core / Test and Build (push) Has been cancelled
This commit is contained in:
@@ -2,15 +2,16 @@ name: Build and Release Core
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches: [ main ] # Runs tests on standard pushes
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # Only trigger when you push a version tag (e.g., v1.0.0)
|
- 'v*' # Runs tests AND builds/releases on tags
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ] # Run tests on PRs, but don't build release binaries
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Test and Build
|
name: Test and Build
|
||||||
runs-on: ubuntu-latest # This runs on your Gitea act_runner
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -18,20 +19,17 @@ jobs:
|
|||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '1.26' # Update to match your go.mod if different
|
go-version: '1.24' # Note: Adjusted to a currently valid Go version
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: go test ./... -v
|
run: go test ./... -v
|
||||||
|
|
||||||
- name: Build Binaries
|
- name: Build Binaries
|
||||||
# Only run the build steps if this was triggered by a tag push
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
|
|
||||||
VERSION=${GITHUB_REF_NAME}
|
VERSION=${GITHUB_REF_NAME}
|
||||||
COMMIT=$(echo ${GITHUB_SHA} | cut -c1-7)
|
COMMIT=$(echo ${GITHUB_SHA} | cut -c1-7)
|
||||||
|
|
||||||
|
|
||||||
LDFLAGS="-X 'main.BuildVersion=$VERSION' -X 'main.BuildCommit=$COMMIT'"
|
LDFLAGS="-X 'main.BuildVersion=$VERSION' -X 'main.BuildCommit=$COMMIT'"
|
||||||
|
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
@@ -45,9 +43,12 @@ jobs:
|
|||||||
echo "Building Windows (amd64)..."
|
echo "Building Windows (amd64)..."
|
||||||
GOOS=windows GOARCH=amd64 go build -ldflags="$LDFLAGS" -o bin/rr-windows-amd64.exe ./cmd/rr/main.go
|
GOOS=windows GOARCH=amd64 go build -ldflags="$LDFLAGS" -o bin/rr-windows-amd64.exe ./cmd/rr/main.go
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Create Release and Upload Binaries
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: actions/upload-artifact@v4
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: riskrancher-core-binaries
|
files: bin/*
|
||||||
path: bin/
|
name: Release ${{ github.ref_name }}
|
||||||
|
generate_release_notes: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
Reference in New Issue
Block a user