From d93b9958981bb7134bf7bf74d4cdb8086fa515a5 Mon Sep 17 00:00:00 2001 From: Alexey Sosnin Date: Mon, 30 Oct 2023 22:17:53 +0300 Subject: [PATCH 1/4] ci: add release workflow --- .github/workflows/create-release.yml | 23 +++++++++++++++++++++++ .github/workflows/push-package.yml | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..41242a7 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,23 @@ +name: Create release + +on: + push: + branches: [ main ] + pull_request: + types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + # write permission is required to create a github release + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Release Drafter + uses: release-drafter/release-drafter@v5.25.0 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push-package.yml b/.github/workflows/push-package.yml index f913da3..6e1eab3 100644 --- a/.github/workflows/push-package.yml +++ b/.github/workflows/push-package.yml @@ -6,7 +6,7 @@ on: pull_request: # Sequence of patterns matched against refs/heads branches: - - main + - main jobs: build: @@ -27,7 +27,7 @@ jobs: run: dotnet test --configuration Release --no-build --verbosity normal - name: Pack release if: ${{ github.ref_name == 'main' }} - run: dotnet pack --configuration Release --no-build + run: dotnet pack --configuration Release --no-build - name: Pack RC if: ${{ github.ref_name != 'main' }} run: dotnet pack --configuration Release --no-build --version-suffix "rc.${GITHUB_RUN_NUMBER}" From 951d0540c55a1d588b2ed5e20c20a989c9bd1fc5 Mon Sep 17 00:00:00 2001 From: Alexey Sosnin Date: Mon, 30 Oct 2023 22:20:02 +0300 Subject: [PATCH 2/4] ci: use GITHUB_TOKEN env --- .github/workflows/create-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 41242a7..ea90fa6 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -19,5 +19,5 @@ jobs: steps: - name: Release Drafter uses: release-drafter/release-drafter@v5.25.0 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cd6be89aa91b159ae803b7d6258871eabf11ed9b Mon Sep 17 00:00:00 2001 From: Alexey Sosnin Date: Mon, 30 Oct 2023 22:21:24 +0300 Subject: [PATCH 3/4] ci: add release template --- .github/release-drafter.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..0a5d792 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,4 @@ +template: | + ## What’s Changed + + $CHANGES \ No newline at end of file From 79efe98809d52960185417f558dd75f440a6d56b Mon Sep 17 00:00:00 2001 From: Alexey Sosnin Date: Mon, 30 Oct 2023 22:23:04 +0300 Subject: [PATCH 4/4] ci: change workflow trigger --- .github/workflows/create-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index ea90fa6..fc26264 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -3,8 +3,9 @@ name: Create release on: push: branches: [ main ] - pull_request: - types: [opened, reopened, synchronize] + # pull_request: + # branches: + # - main permissions: contents: read