From 25c655cfefb38a814f49ccc903ae5bc7c7ff7f06 Mon Sep 17 00:00:00 2001 From: mikhail-klimko Date: Fri, 29 Sep 2023 18:13:30 +0300 Subject: [PATCH] ci: add release-drafter --- .github/PULL_REQUEST_TEMPLATE.md | 6 +++++ .github/release-drafter.yaml | 8 +++++++ .github/workflows/draft-release.yaml | 35 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/release-drafter.yaml create mode 100644 .github/workflows/draft-release.yaml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d52927c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +## What + +## Why + +## Notes + \ No newline at end of file diff --git a/.github/release-drafter.yaml b/.github/release-drafter.yaml new file mode 100644 index 0000000..56a1084 --- /dev/null +++ b/.github/release-drafter.yaml @@ -0,0 +1,8 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +template: | + ## Changes + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/draft-release.yaml b/.github/workflows/draft-release.yaml new file mode 100644 index 0000000..49d8750 --- /dev/null +++ b/.github/workflows/draft-release.yaml @@ -0,0 +1,35 @@ +## Reference: https://github.com/release-drafter/release-drafter +name: Create Release + +on: + push: + branches: + - rootless + +jobs: + create_release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up YQ + uses: frenck/action-setup-yq@v1 + + - name: Get release version from service.yaml + run: | + RELEASE_VERSION=$(yq eval '.version' service.yaml ) + echo "RELEASE_VERSION=v$RELEASE_VERSION-rootless" >> $GITHUB_ENV + + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + publish: true + name: ${{ env.RELEASE_VERSION }} + version: ${{ env.RELEASE_VERSION }} + tag: ${{ env.RELEASE_VERSION }} + config-name: release-drafter.yaml