make a golang build script for projector

This commit is contained in:
Greg Gauthier 2024-07-21 03:51:16 +01:00
parent 8af2fd3304
commit 476e47529c
2 changed files with 24 additions and 27 deletions

24
.gitea/workflows/build.yml Executable file
View File

@ -0,0 +1,24 @@
name: gobuild
on: [push]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Golang Essentials
run: wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz && export PATH=$PATH:/usr/local/go/bin
- name: Test Go installation
run: go version
- name: Build
script:
- mkdir ./build
- go mod tidy
- go build -a -V -o ./build/ .

View File

@ -1,27 +0,0 @@
# Template Go (Golang) build
# This template allows you to validate your Go (Golang) code.
# The workflow allows running tests, build and code linting on the default branch.
image: golang:1.15
pipelines:
default:
- parallel:
- step:
name: Lint code
image: golangci/golangci-lint:v1.31.0
script:
- golangci-lint run -v
- step:
name: Test and Build
script:
# - mkdir test-reports
# - go get -u github.com/jstemmer/go-junit-report
# - go test tests/* -v 2>&1 | go-junit-report > test-reports/report.xml
# Build compiles the packages
- mkdir ./build
- go version
- go mod tidy
- go build -a -v -o ./build/ .
- curl -X POST --user "${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"./build/projector"