From 032491166aaa52cb8fcd878afe28805ab0a79082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Agostinho=20de=20Sousa?= Date: Wed, 19 Aug 2026 14:11:13 +0200 Subject: [PATCH] Add gitea specific workflow --- .gitea/workflows/release.yml | 86 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 4 +- 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..5404f27 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,86 @@ +name: Release + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + build: + name: Build ${{ matrix.name }} + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - goos: linux + goarch: amd64 + name: linux-amd64 + extension: "" + + - goos: linux + goarch: arm64 + name: linux-arm64 + extension: "" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Build + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + CGO_ENABLED: 0 + VERSION: ${{ gitea.ref_name }} + run: | + mkdir -p dist + go build \ + -ldflags="-X main.version=${VERSION}" \ + -o "dist/cryosparc-merlin-${{ matrix.name }}${{ matrix.extension }}" \ + . + + - name: Upload binary artifact + uses: actions/upload-artifact@v3 + with: + name: cryosparc-merlin-${{ matrix.name }} + path: dist/cryosparc-merlin-${{ matrix.name }}${{ matrix.extension }} + + release: + name: Create release + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download binaries + uses: actions/download-artifact@v3 + with: + pattern: cryosparc-merlin-* + path: dist + merge-multiple: true + + - name: Generate checksums + working-directory: dist + run: | + sha256sum * > checksums.txt + + - name: Create Gitea Release + uses: akkuman/gitea-release-action@v1 + with: + server_url: ${{ gitea.server_url }} + repository: ${{ gitea.repository }} + tag_name: ${{ gitea.ref_name }} + name: ${{ gitea.ref_name }} + body: | + Release ${{ gitea.ref_name }} + files: | + dist/cryosparc-merlin-* + dist/checksums.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dae56b6..a6912bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: . - name: Upload binary artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v7 with: name: cryosparc-merlin-${{ matrix.name }} path: dist/cryosparc-merlin-${{ matrix.name }}${{ matrix.extension }} @@ -62,7 +62,7 @@ jobs: steps: - name: Download binaries - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v8 with: pattern: cryosparc-merlin-* path: dist