diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml new file mode 100644 index 0000000..7e6624b --- /dev/null +++ b/.github/workflows/tags.yml @@ -0,0 +1,30 @@ +name: Go-tags +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.23.x' + - name: install dependencies + run: go get . + - name: Build + env: + TAG_VERSION: ${{ github.ref_name }} + run: | + go build -v -o ./bin/ddnser-$TAG_VERSION ./cmd/... + zip -r ddnser-$TAG_VERSION ./bin/ddnser-$TAG_VERSION + - name: Push to gitea + env: + USERNAME: ${{ vars.USERNAME }} + TOKEN: ${{ secrets.TOKEN }} + TAG_VERSION: ${{ github.ref_name }} + run: curl --user $USERNAME:$TOKEN \ + --upload-file bin/ddnser-$TAG_VERSION.zip \ + http://10.0.0.171/api/packages/$USERNAME/go/upload