From 2b74b8d3c7af26525e43670a651b77e4f7f2f169 Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 6 Nov 2024 18:02:42 +0000 Subject: [PATCH] feat: Add release drafter common github action. --- .github/workflows/check-release.yml | 3 +-- .github/workflows/checks.yml | 9 +++++++++ .github/workflows/release-drafter.yml | 26 ++++++++++++++++++++++++++ .github/workflows/release.yml | 12 ++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/checks.yml create mode 100644 .github/workflows/release-drafter.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 6581afc..d133f14 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -1,8 +1,7 @@ # WARNING: Actions in this file can access repository secrets. They should never # execute code of the pull request. All scripts should be fetched from merged # TokTok code. -on: - workflow_call: +on: [workflow_call] jobs: check-release: diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..888effa --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,9 @@ +name: checks + +on: + pull_request_target: + branches: [master] + +jobs: + checks: + uses: ./.github/workflows/check-release.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..05f8ac5 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,26 @@ +# WARNING: Actions in this file can access repository secrets. They should never +# execute code of the pull request. All scripts should be fetched from merged +# TokTok code. +on: [workflow_call] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v6 + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + # with: + # config-name: my-config.yml + # disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..69c6a42 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,12 @@ +name: release + +on: + push: + branches: [master] + pull_request_target: + branches: [master] + types: [opened, reopened, synchronize] + +jobs: + release: + uses: ./.github/workflows/release-drafter.yml