From a1937be0675cbcb1186db9e2f11bb80a56c4a926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Kro=CC=88ner?= Date: Tue, 5 Nov 2024 13:48:53 +0100 Subject: [PATCH] ci: Add automatic release step for tags --- .github/workflows/build-release.yml | 38 ++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index a0c2195..f73e5df 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,19 +1,11 @@ -# SPDX-License-Identifier: MIT -# -# https://code.forgejo.org/forgejo/runner -# -# Build the runner binaries and OCI images -# -# ROLE: forgejo-integration -# DOER: forgejo-ci -# TOKEN: -# + name: Build release on: - workflow_dispatch: + push: + tags: 'v*' jobs: - release: + build: runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -27,3 +19,25 @@ jobs: with: name: forgejo-runner path: forgejo-runner.exe + + release: + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'push' && github.ref_type == 'tag' + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: forgejo-runner + path: . + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + files: forgejo-runner.exe + draft: false + prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} + token: ${{ secrets.GITHUB_TOKEN }} + body: See [original release notes](https://code.forgejo.org/forgejo/runner/releases/tag/${{ github.ref_name }}). +