From ecdfc7445ed07a113387c0c6c1d03fef41fe4f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sun, 19 Nov 2023 21:35:48 +0100 Subject: [PATCH] Workflow: tag and create release --- .../release/create-release-on-tag.yaml | 19 ++++++++++++++ ...ag-when-pr-merged-from-branch-release.yaml | 25 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .gitea/workflows/release/create-release-on-tag.yaml create mode 100644 .gitea/workflows/release/tag-when-pr-merged-from-branch-release.yaml diff --git a/.gitea/workflows/release/create-release-on-tag.yaml b/.gitea/workflows/release/create-release-on-tag.yaml new file mode 100644 index 0000000..349b57f --- /dev/null +++ b/.gitea/workflows/release/create-release-on-tag.yaml @@ -0,0 +1,19 @@ +name: Create release +run-name: Create release on tag + +permissions: + contents: write + +on: + push: + tags: + - v* + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: release + uses: https://github.com/softprops/action-gh-release@v1 + with: + body_path: ${{ github.workspace }}/.changes/v${{ github.ref }}.md diff --git a/.gitea/workflows/release/tag-when-pr-merged-from-branch-release.yaml b/.gitea/workflows/release/tag-when-pr-merged-from-branch-release.yaml new file mode 100644 index 0000000..947606d --- /dev/null +++ b/.gitea/workflows/release/tag-when-pr-merged-from-branch-release.yaml @@ -0,0 +1,25 @@ +name: Tag next release +run-name: Create a tag when PR is merged + +on: + pull_request_target: + types: + - closed + branches: + - 'main' + +jobs: + tag_if_merged: + if: github.event.pull_request.merged == true and startsWith(github.head_ref, 'release/') + runs-on: ubuntu-latest + steps: + - name: changie latest + id: changie_latest + uses: https://github.com/miniscruff/changie-action@v2 + with: + version: latest + args: 'latest' + - name: create a tag + uses: https://github.com/rickstaa/action-create-tag@v1 + with: + tag: ${{ steps.changie_latest.outputs.output }}