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

View File

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

View File

@ -106,7 +106,7 @@ jobs:
# 2. create release note # 2. create release note
- name: "create release note" - name: "create release note"
run: | run: |
VERSION=${{ needs.version.outputs.new }} NEW_VERSION=${{ needs.version.outputs.new }}
CURRENT_VERSION=${{ needs.version.outputs.current }} CURRENT_VERSION=${{ needs.version.outputs.current }}
STATUS=0 STATUS=0
## ================================= ## =================================
@ -114,18 +114,18 @@ jobs:
## --------------------------------- ## ---------------------------------
TOP=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1) TOP=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
BOTTOM=$(grep -n -m 1 "## Version \[$CURRENT_VERSION\]" 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 awk "NR>$TOP&&NR<$BOTTOM" CHANGELOG.md > release-note-v$NEW_VERSION.md
sed -i -- "s/###/##/g" release-note-v$VERSION.md sed -i -- "s/###/##/g" release-note-v$NEW_VERSION.md
## ================================= ## =================================
## check if release note is empty ## 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 if [[ $WORD_COUNT -lt 4 ]]; then
STATUS=1 STATUS=1
fi fi
if [ $STATUS = 1 ]; then if [ $STATUS = 1 ]; then
echo "- :no_entry_sign: 'Unreleased' section in CHANGELOG.md is empty" >> $GITHUB_STEP_SUMMARY 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 exit 1
else else
echo "- 'Unreleased' section in CHANGELOG.md has content :white_check_mark:" >> $GITHUB_STEP_SUMMARY 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 ## 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 # 3. create release archive
- name: "create release archive" - name: "create release archive"