diff --git a/.github/workflows/custom-release-draft.yml b/.github/workflows/custom-release-draft.yml new file mode 100644 index 000000000..6b850a7c4 --- /dev/null +++ b/.github/workflows/custom-release-draft.yml @@ -0,0 +1,45 @@ +name: Custom Release Draft + +on: + workflow_call: + inputs: + target_branch: + required: false + type: string + default: master + push: + branches: + - master + - feat/release-drafter + workflow_dispatch: + +jobs: + release-draft: + runs-on: ubuntu-latest + steps: + - name: Checkout target repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm install @octokit/rest @octokit/graphql + + - name: Download release-notes.js + run: | + set -e + mkdir -p .github/scripts + echo "Trying to download release-notes.js from feat/release-drafter..." + if ! curl -fsSL "https://raw.githubusercontent.com/Adamant-im/.github/feat/release-drafter/.github/scripts/release-notes.js" -o .github/scripts/release-notes.js; then + echo "feat/release-drafter not found, downloading from master..." + curl -fsSL "https://raw.githubusercontent.com/Adamant-im/.github/master/.github/scripts/release-notes.js" -o .github/scripts/release-notes.js + fi + + - name: Run release notes script + run: node .github/scripts/release-notes.js + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }}