Files
samba-configer/.gitea/workflows/build.yaml
T
dakota a2d37e54f4
Build and Publish / build (push) Successful in 9m31s
i'm going to figure this out
2026-03-24 20:13:14 +00:00

56 lines
1.5 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: Check upload auth
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
echo "${SERVER_URL}"
echo "${REPOSITORY_OWNER}"
echo "${VERSION}"
echo "${GITEA_ACTOR}"
test -n "$GITEA_TOKEN" || { echo "GITEA_TOKEN is empty"; exit 1; }
- 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 }}
run: |
test -n "$GITEA_TOKEN" || { echo "GITEA_TOKEN is empty"; exit 1; }
VERSION="${GITEA_REF_NAME}"
curl --fail-with-body \
--user "${GITEA_ACTOR}:${GITEA_TOKEN}" \
--upload-file dist/samba-configer \
"${SERVER_URL}/api/packages/${REPOSITORY_OWNER}/generic/samba-configer/${VERSION}/samba-configer-linux-amd64"