diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..3ed3484 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,37 @@ +--- +changelog: + categories: + - title: โœ… Added + labels: + - docs + - feature + - title: ๐Ÿ” Changed + labels: + - chore + - dependencies + - enhancement + - perf + - refactor + - style + - title: ๐Ÿ›‘ Deprecated + labels: + - deprecated + - title: ๐Ÿ”ง Fixed + labels: + - bug + - title: ๐Ÿ—‘๏ธ Removed + labels: + - removed + - title: ๐Ÿ›ก๏ธ Security + labels: + - security + - title: ๐Ÿงช Test + labels: + - test + exclude: + labels: + - duplicate + - good first issue + - invalid + - question + - wontfix diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..66ad7f5 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,41 @@ +name: Create release + +on: + push: + tags: + - "*.*.*" + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - name: Prerelease check + run: | + if [[ ${{ github.ref_name }} =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then + echo "prerelease=false" >> $GITHUB_ENV + else + echo "prerelease=true" >> $GITHUB_ENV + fi + + - name: Create release + uses: actions/github-script@v6 + env: + name: ${{ github.ref_name }} + prerelease: ${{ env.prerelease }} + with: + script: | + try { + const response = await github.rest.repos.createRelease({ + generate_release_notes: true, + name: process.env.name, + owner: context.repo.owner, + prerelease: process.env.prerelease === "true", + repo: context.repo.repo, + tag_name: process.env.name, + }); + + return response.data.id; + } catch (error) { + core.setFailed(error.message); + }