This commit is contained in:
+16
-10
@@ -1,9 +1,11 @@
|
|||||||
name: Build
|
name: Build and Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -19,17 +21,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test ./...
|
run: go test ./...
|
||||||
|
|
||||||
- name: Build binary
|
- 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
|
- name: Upload package
|
||||||
uses: actions/upload-artifact@v4
|
if: startsWith(gitea.ref, 'refs/tags/')
|
||||||
with:
|
env:
|
||||||
name: samba-configer
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
path: samba-configer
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user