diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index ab47b3a..78f677c 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -7,25 +7,30 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: Checkout last commit + - name: Checkout repo uses: actions/checkout@v2 with: fetch-depth: 0 submodules: 'recursive' - - name: Archive config + - name: Archive rimerc run: make archive - name: Build changelog - id: relase_log - uses: mikepenz/release-changelog-builder-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + id: release_log + run: | + log=$(./script/changelog.sh) + # multiline + log="${log//'%'/'%25'}" + log="${log//$'\n'/'%0A'}" + log="${log//$'\r'/'%0D'}" + + echo "::set-output name=changelog::$log" - name: Create release uses: ncipollo/release-action@v1 with: artifacts: "release/*.zip" body: | - ${{ steps.relase_log.outputs.changelog }} + ${{ steps.release_log.outputs.changelog }} token: ${{ secrets.GITHUB_TOKEN }} diff --git a/script/changelog.sh b/script/changelog.sh new file mode 100755 index 0000000..67e6c31 --- /dev/null +++ b/script/changelog.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +current=$(git describe --tags --abbrev=0) +previous=$(git describe --always --abbrev=0 --tags ${current}^) + +git log --oneline --decorate ${previous}...${curent} --pretty="format:- %h %s" | grep -v Merge