[CI] Auto Update CHANGELOG.md #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- master | |
paths: | |
- 'CHANGELOG.md' | |
jobs: | |
create_release: | |
name: Create Release | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: "Determine tag" | |
run: | | |
git fetch --all | |
RELEASE_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo $RELEASE_TAG | |
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
- name: "Create release" | |
uses: "actions/github-script@v6" | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
script: | | |
try { | |
const response = await github.rest.repos.createRelease({ | |
draft: false, | |
generate_release_notes: true, | |
name: process.env.RELEASE_TAG, | |
owner: context.repo.owner, | |
prerelease: false, | |
repo: context.repo.repo, | |
tag_name: process.env.RELEASE_TAG, | |
}); | |
core.exportVariable('RELEASE_ID', response.data.id); | |
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); | |
} catch (error) { | |
core.setFailed(error.message); | |
} |