From afbd0433d94441c931272fe1e11f766c188b64a9 Mon Sep 17 00:00:00 2001 From: PedanXr Date: Wed, 16 Jul 2025 16:18:27 +0200 Subject: [PATCH] Added gitea action --- .gitea/workflows/build-and-release.yml | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .gitea/workflows/build-and-release.yml diff --git a/.gitea/workflows/build-and-release.yml b/.gitea/workflows/build-and-release.yml new file mode 100644 index 0000000..41dbf74 --- /dev/null +++ b/.gitea/workflows/build-and-release.yml @@ -0,0 +1,59 @@ +name: Build & Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, windows] + goarch: [amd64, arm] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22.x' + + - name: Build binary + run: | + GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/app-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} main.go + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: app-${{ matrix.goos }}-${{ matrix.goarch }} + path: dist/app-* + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: ./dist + + - name: Create Release & Attach Files + uses: rosven9856/gitea_creating_release_action@master + with: + gitea_schema: 'https' + gitea_host: 'git.ztsw.de' + gitea_organization: 'pedan' + gitea_repo: 'go-fileserver' + access_token: ${{ secrets.GITEA_TOKEN }} + release_body: 'Auto-build release' + release_draft: 'false' + release_name: ${{ github.ref_name }} + release_prerelease: 'false' + release_tag_name: ${{ github.ref_name }} + release_target_commitish: ${{ github.sha }} + # Optional: attach all built binaries + env: + ASSETS_PATH: ./dist/app-*