improved and fixed actions

master
Martin Scheidt 2022-12-30 19:14:26 +01:00
parent 7467babb4a
commit 00f147e5cb
3 changed files with 15 additions and 14 deletions

View File

@ -17,6 +17,7 @@ on:
- '.github/workflows/release.yml'
- '.github/workflows/TagBot.yml'
- '.github/zenodo/*'
- 'docs'
pull_request:
branches: [ main, development ]
paths-ignore:
@ -34,6 +35,7 @@ on:
- '.github/workflows/release.yml'
- '.github/workflows/TagBot.yml'
- '.github/zenodo/*'
- 'docs'
workflow_dispatch:
concurrency:

View File

@ -15,20 +15,19 @@ jobs:
debug:
name: "debug"
outputs:
runs-on: ubuntu-latest
steps:
- name: "checkout"
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v3
# ## opening a debug console
# - name: Setup upterm session
# env:
# ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
# uses: lhotari/action-upterm@v1
# with:
# limit-access-to-actor: true
## opening a debug console
- name: Setup upterm session
env:
ZENODO_SANDBOX_ACCESS_TOKEN: ${{ secrets.ZENODO_SANDBOX_ACCESS_TOKEN }}
uses: lhotari/action-upterm@v1
with:
limit-access-to-actor: true
# debug1:
# name: "debug 1"

View File

@ -106,7 +106,7 @@ jobs:
# 2. create release note
- name: "create release note"
run: |
VERSION=${{ needs.version.outputs.new }}
NEW_VERSION=${{ needs.version.outputs.new }}
CURRENT_VERSION=${{ needs.version.outputs.current }}
STATUS=0
## =================================
@ -114,18 +114,18 @@ jobs:
## ---------------------------------
TOP=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
BOTTOM=$(grep -n -m 1 "## Version \[$CURRENT_VERSION\]" CHANGELOG.md | cut -d: -f1)
awk "NR>$TOP&&NR<$BOTTOM" CHANGELOG.md > release-note-v$VERSION.md
sed -i -- "s/###/##/g" release-note-v$VERSION.md
awk "NR>$TOP&&NR<$BOTTOM" CHANGELOG.md > release-note-v$NEW_VERSION.md
sed -i -- "s/###/##/g" release-note-v$NEW_VERSION.md
## =================================
## check if release note is empty
## ---------------------------------
WORD_COUNT=$(wc -w release-note-v$VERSION.md | awk '{print $1}')
WORD_COUNT=$(wc -w release-note-v$NEW_VERSION.md | awk '{print $1}')
if [[ $WORD_COUNT -lt 4 ]]; then
STATUS=1
fi
if [ $STATUS = 1 ]; then
echo "- :no_entry_sign: 'Unreleased' section in CHANGELOG.md is empty" >> $GITHUB_STEP_SUMMARY
echo ":warning: Please provide a meaningful CHANGELOG.md for the new version $VERSION"." >> $GITHUB_STEP_SUMMARY
echo ":warning: Please provide a meaningful CHANGELOG.md for the new version $NEW_VERSION." >> $GITHUB_STEP_SUMMARY
exit 1
else
echo "- 'Unreleased' section in CHANGELOG.md has content :white_check_mark:" >> $GITHUB_STEP_SUMMARY
@ -133,7 +133,7 @@ jobs:
## =================================
## remove empty lines from top and bottom
## ---------------------------------
sed -i -- -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' release-note-v$VERSION.md
sed -i -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' release-note-v$NEW_VERSION.md
# 3. create release archive
- name: "create release archive"