From 7633fc4a98f028b6828998c78cbf843ff5b2aca1 Mon Sep 17 00:00:00 2001 From: DCreason Date: Fri, 20 Mar 2026 21:31:46 +0000 Subject: [PATCH] work on failing CI/CD pipeline --- .gitea/workflows/build.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index ab32684..e9274db 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,9 +1,11 @@ -name: Build +name: Build and Publish on: push: branches: - main + tags: + - 'v*' pull_request: jobs: @@ -19,17 +21,21 @@ jobs: with: go-version-file: go.mod - - name: Download dependencies - run: go mod download - - name: Run tests run: go test ./... - name: Build binary - run: go build -v -o samba-configer . + run: | + mkdir -p dist + go build -v -o dist/samba-configer . - - name: Upload binary artifact - uses: actions/upload-artifact@v4 - with: - name: samba-configer - path: 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"