Push Release #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push Release | |
on: workflow_dispatch | |
jobs: | |
release: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout latest repository commit | |
uses: actions/checkout@v4.1.1 | |
with: | |
show-progress: false | |
- id: get-tag | |
name: Fetches latest release tag | |
shell: bash | |
run: | | |
LATEST_TAG="$(grep -m 1 -o '## \[.*\]' Changelog.md | awk -F'[][]' '{print $2}')" | |
echo "TAG=$LATEST_TAG" >> "$GITHUB_ENV" | |
- name: Rename folders and files | |
run: | | |
mv CLI DuoXPy-CLI | |
mv Core DuoXPy-Core | |
mv GUI DuoXPy-GUI | |
mv DuoXPy-CLI/DuoXPy-CLI.py DuoXPy-CLI/DuoXPy.py | |
mv DuoXPy-Core/DuoXPy-Core.py DuoXPy-Core/DuoXPy.py | |
mv DuoXPy-GUI/DuoXPy-GUI.py DuoXPy-GUI/DuoXPy.py | |
- name: Zip folders | |
run: | | |
zip -r DuoXPy-CLI.zip DuoXPy-CLI | |
zip -r DuoXPy-Core.zip DuoXPy-Core | |
zip -r DuoXPy-GUI.zip DuoXPy-GUI | |
env: | |
TAG: ${{ env.TAG }} | |
- id: generate-notes | |
name: Generate Release Notes | |
shell: bash | |
run: | | |
BODY="$(sed -n "/## \[$TAG\]/,/## \[/p" Changelog.md | sed -e '1,2d;$d')" | |
echo "$BODY" > ${{ github.workspace }}-RELEASE_NOTES.txt | |
env: | |
TAG: ${{ env.TAG }} | |
- name: Create release | |
uses: softprops/action-gh-release@v0.1.15 | |
with: | |
name: v${{ env.TAG }} | |
tag_name: ${{ env.TAG }} | |
body_path: ${{ github.workspace }}-RELEASE_NOTES.txt | |
files: DuoXPy-CLI.zip, DuoXPy-Core.zip, DuoXPy-GUI.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |