From 2d6c20943e4d13ea5df7d8efe6487eb68a64ef9c Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 15 Apr 2022 10:39:36 -0700 Subject: [PATCH] new: dev: add release workflow (just to generate release page) Signed-off-by: Stephen L Arnold --- .github/workflows/release.yml | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0a0233b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Release + +on: + push: + # release on tag push + tags: + - '*' + +jobs: + gitchangelog_test: + + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + name: Test changelog + steps: + # To use this repository's private action, + # you must check out the repository + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get version + id: get_version + run: | + echo "VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV + echo ${{ env.VERSION }} + + - name: gitchangelog action step (debug) + uses: ./ # Uses an action in the root directory + with: + github_token: ${{ secrets.GITHUB_TOKEN}} + + - name: Display changes file + run: cat CHANGES.md + + - name: Test changes file + run: | + export VERSION=${{ env.VERSION }} + export TITLE_VERSION=$(cat CHANGES.md | head -n1 | cut -f2 -d" ") + if [[ -z $VERSION ]]; then + [[ "${TITLE_VERSION}" == "(unreleased)" ]] || exit 1 + else + [[ "${TITLE_VERSION}" == "${VERSION}" ]] || exit 1 + fi + + - name: Create release + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSION }} + name: Release v${{ env.VERSION }} + body_path: CHANGES.md + draft: false + prerelease: false