From 076cd0bc1e40ca171a823c542efe289b51a466f0 Mon Sep 17 00:00:00 2001 From: Hoang Mirs Date: Sun, 22 Oct 2023 22:26:49 +0700 Subject: [PATCH 1/3] [#145] Add a workflow to draft a new release --- .github/release-drafter.yml | 12 ++++++++++ .github/workflows/draft-new-release.yml | 32 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/draft-new-release.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..34f78823 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,12 @@ +name-template: '$RESOLVED_VERSION' +tag-template: '$RESOLVED_VERSION' +categories: + - title: 'โญ Features' + label: 'type : feature' + - title: '๐Ÿงน Chores' + label: 'type : chore' + - title: '๐Ÿž Bugs' + label: 'type : bug' +change-template: '- $TITLE' +template: | + $CHANGES diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml new file mode 100644 index 00000000..6a591d46 --- /dev/null +++ b/.github/workflows/draft-new-release.yml @@ -0,0 +1,32 @@ +name: Draft a new release + +on: + push: + branches: + - main + +env: + VERSION_FILE: ./package.json + +jobs: + draft-new-release: + name: Draft a new release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get current version + id: current_version + run: | + currentVersion=$(node -p -e "require('${{ env.VERSION_FILE }}').version") + echo "version=$currentVersion" >> $GITHUB_OUTPUT + + - name: Draft a new release + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + version: ${{ steps.current_version.outputs.version }} From e189331c240a0eb2399a9c827033a0dc4359d564 Mon Sep 17 00:00:00 2001 From: Hoang Mirs Date: Mon, 23 Oct 2023 13:34:44 +0700 Subject: [PATCH 2/3] [#145] Change to test the draft-new-release --- .github/workflows/draft-new-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 6a591d46..64189883 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -3,7 +3,7 @@ name: Draft a new release on: push: branches: - - main + - feature/gh-145-add-draft-new-release-workflow env: VERSION_FILE: ./package.json From 4323ca238c3d2071cacb0302e711c97a78a4f8d2 Mon Sep 17 00:00:00 2001 From: Hoang Mirs Date: Mon, 23 Oct 2023 13:42:51 +0700 Subject: [PATCH 3/3] [#145] Revert previous change --- .github/workflows/draft-new-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 64189883..6a591d46 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -3,7 +3,7 @@ name: Draft a new release on: push: branches: - - feature/gh-145-add-draft-new-release-workflow + - main env: VERSION_FILE: ./package.json