From 51e44abc6b19564b36a9f3a0fbf14287a0db02c1 Mon Sep 17 00:00:00 2001 From: Dele Omotosho Date: Fri, 1 Sep 2023 08:40:43 -0400 Subject: [PATCH] ci: add update with release notes --- .github/workflows/compileandrelease.yml | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compileandrelease.yml b/.github/workflows/compileandrelease.yml index bb3b01a..ee3382e 100644 --- a/.github/workflows/compileandrelease.yml +++ b/.github/workflows/compileandrelease.yml @@ -2,8 +2,7 @@ name: Compile Latex and Release PDF on: push: - tags: - - '*.*.*' + branches: [ env/r ] jobs: build_latex: @@ -16,6 +15,29 @@ jobs: uses: xu-cheng/latex-action@v2 with: root_file: main.tex + - name: install semverbot + run: | + curl -o bin/sbot -L https://github.com/restechnica/semverbot/releases/download/v$SEMVERBOT_VERSION/sbot-linux-amd64 + chmod +x bin/sbot + - name: update version + run: | + sbot update version + current_version="$(sbot get version)" + release_version="$(sbot predict version -m patch)" + + echo "CURRENT_VERSION=${current_version}" >> $GITHUB_ENV + echo "RELEASE_VERSION=${release_version}" >> $GITHUB_ENV + + echo "current version: ${current_version}" + echo "next version: ${release_version}" + + - name: release version + run: | + sbot release version + sbot push version + + - name: Generate Changelog + run: git log "$CURRENT_VERSION"..."$RELEASE_VERSION" --pretty=%s --first-parent > ${{ github.workspace }}-CHANGELOG.txt - name: Create Release uses: softprops/action-gh-release@v1 @@ -23,5 +45,6 @@ jobs: with: generate_release_notes: true discussion_category_name: "General" + body_path: ${{ github.workspace }}-CHANGELOG.txt files: | main.pdf