Skip to content

Commit

Permalink
update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Feb 18, 2021
1 parent 3b83bad commit 81b58ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
#----------------------------------------------------------------------------
release-notes:
name: Release Notes 📰
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
Expand All @@ -24,8 +23,9 @@ jobs:
# Check 2 most recent tags, overwrites
- name: Tagged Release Notes
run: |
workflow/scripts/notes_release.sh `git tag | tail -n2 | head -n1` `git tag | tail -n1` > release-notes.md
- name: Upload Artifact
./autologs --release -o release-notes.md --old-tag `git tag | tail -n2 | head -n1` --new-tag ${{ github.ref }}
- name: Upload Release Notes
uses: actions/upload-artifact@v2
with:
name: release-notes
Expand All @@ -35,7 +35,6 @@ jobs:
tagged-release:
name: Tagged Release
needs: [release-notes]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
Expand All @@ -54,5 +53,5 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
prerelease: true
body_path: release-notes.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bak
9 changes: 8 additions & 1 deletion autologs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ NUM_TAGS=${#ARR_TAGS[@]}
# An obscure way to reverse a list
ARR_TAGS=(`for ((i=${NUM_TAGS}-1; i>=0; i--)); do echo ${ARR_TAGS[$i]}; done | tr '\n' ' ' `)


#------------------------------------------------------------------------------
# Retrieve the absolute path of the executing script
AbsPath()
Expand Down Expand Up @@ -312,6 +311,14 @@ else
NEW_TAG_NAME="$NEW_TAG"
fi

# If there are 0 tags, use first and HEAD
if [[ `git tag | wc -l` == '0' ]]; then
OLD_VER=$FIRST_COMMIT
NEW_VER="HEAD"
elif [[ `git tag | wc -l` == '1' ]]; then
OLD_VER=$FIRST_COMMIT
fi

# Rename and backup old output file if it exists
if [[ $OUT_FILE != "/dev/stdout" && -f $OUT_FILE ]]; then
mv $OUT_FILE ${OUT_FILE}.bak
Expand Down

0 comments on commit 81b58ac

Please sign in to comment.