Files
samba-configer/.gitea/workflows/build.yaml
T
dakota 7633fc4a98
Build and Publish / build (push) Failing after 4m52s
work on failing CI/CD pipeline
2026-03-20 21:31:46 +00:00

42 lines
963 B
YAML

name: Build and Publish
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: go test ./...
- name: Build binary
run: |
mkdir -p dist
go build -v -o dist/samba-configer .
- name: Upload package
if: startsWith(gitea.ref, 'refs/tags/')
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
VERSION="${GITEA_REF_NAME}"
curl --fail-with-body \
--user "${GITEA_ACTOR}:${GITEA_TOKEN}" \
--upload-file dist/samba-configer \
"${GITEA_SERVER_URL}/api/packages/${GITEA_REPOSITORY_OWNER}/generic/samba-configer/${VERSION}/samba-configer-linux-amd64"