Files
samba-configer/.gitea/workflows/build.yaml
T
dakota 2cab803d83
Build and Publish / build (push) Failing after 4m51s
another try at fix CI/CD
2026-03-21 17:11:42 +00:00

45 lines
1.1 KiB
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 }}
SERVER_URL: ${{ gitea.server_url }}
REPOSITORY_OWNER: ${{ gitea.repository_owner }}
VERSION: ${{ gitea.ref_name }}
ACTOR: ${{ gitea.actor }}
run: |
curl --fail-with-body \
--user "${ACTOR}:${GITEA_TOKEN}" \
--upload-file dist/samba-configer \
"${SERVER_URL}/api/packages/${REPOSITORY_OWNER}/generic/samba-configer/${VERSION}/samba-configer-linux-amd64"