diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..9c32a8f --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,18 @@ +changelog: + categories: + - title: Breaking Changes ๐Ÿ›  + labels: + - breaking change + - title: Exciting New Features ๐ŸŽ‰ + labels: + - enhancement + - title: Bug Fixes ๐Ÿ› + labels: + - bug + - title: Maintenance ๐Ÿงน + labels: + - chore + - documentation + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index b9a7461..3d6ab68 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -8,40 +8,13 @@ on: jobs: cd: runs-on: ubuntu-latest - outputs: - release_body: ${{ steps.release.outputs.RELEASE_BODY }} steps: - - name: Set the release version - shell: bash - run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Create changes - shell: bash - run: touch CHANGES.md - - name: Generate a changelog - uses: orhun/git-cliff-action@v1 - id: git-cliff - with: - config: cliff.toml - args: -vv --latest --strip header + - name: Create release note env: - OUTPUT: CHANGES.md - - name: Set the release body - id: release - shell: bash + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} run: | - r=$(cat ${{ steps.git-cliff.outputs.changelog }}) - r="${r//'%'/'%25'}" # Multiline escape sequences for % - r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n' - r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r' - echo "::set-output name=RELEASE_BODY::$r" - - name: Create the release - uses: softprops/action-gh-release@v1 - with: - name: "Release v${{ env.RELEASE_VERSION }}" - body: ${{ steps.release.outputs.RELEASE_BODY }} - env: - GITHUB_REPOSITORY: dylandoamaral/trakt-integration + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ + --generate-notes \ No newline at end of file diff --git a/cliff.toml b/cliff.toml deleted file mode 100644 index a67d3d1..0000000 --- a/cliff.toml +++ /dev/null @@ -1,47 +0,0 @@ -# configuration file for git-cliff (0.1.0) - -[changelog] -# changelog header -header = """""" -# template for the changelog body -# https://tera.netlify.app/docs/#introduction -body = """ -โš ๏ธ The project is still under active development. Until `1.0.0`, breaking changes can be included in MINOR versions. -{% if version %}\ - ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} -{% else %}\ - ## [unreleased] -{% endif %}\ -{% for group, commits in commits | group_by(attribute="group") %} - ### {{ group | upper_first }} - {% for commit in commits %} - - {{ commit.message | upper_first }}\ - {% endfor %} -{% endfor %}\n -""" -# remove the leading and trailing whitespaces from the template -trim = true -# changelog footer -footer = """""" - -[git] -# allow only conventional commits -# https://www.conventionalcommits.org -conventional_commits = true -# regex for parsing and grouping commits -commit_parsers = [ - { message = "^feat", group = "Features" }, - { message = "^fix", group = "Bug Fixes" }, - { message = "^doc", group = "Documentation" }, - { message = "^perf", group = "Performance" }, - { message = "^refactor", group = "Refactor" }, - { message = "^style", group = "Styling" }, - { message = "^test", group = "Testing" }, - { message = "^chore\\(release\\): prepare for", skip = true }, - { message = "^chore", group = "Miscellaneous Tasks" }, - { body = ".*security", group = "Security" }, -] -# filter out the commits that are not matched by commit parsers -filter_commits = false -# glob pattern for matching git tags -tag_pattern = "v[0-9]*"