change release workflow

This commit is contained in:
Send_Nukez 2021-10-28 01:43:25 +02:00
parent 6f86bc76f9
commit 60863b5464
2 changed files with 43 additions and 16 deletions

34
.github/workflows/empty-changelog.yaml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Empty CHANGELOG.md
on:
release:
types: [published]
jobs:
empty-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.repository.default_branch }}
- name: Empty CHANGELOG.md
run: |
git config --global user.email "action@github.com"
git config --global user.name "github-actions"
if [ -s CHANGELOG.md ]; then
echo "Comitting emptied CHANGELOG.md"
else
echo "CHANGELOG.md is already empty. skipping comitting"
exit 0
fi
rm CHANGELOG.md
touch CHANGELOG.md
git add CHANGELOG.md
git commit -m "Empty CHANGELOG.md"
git push

View file

@ -19,7 +19,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Setup Node.js
@ -35,34 +34,28 @@ jobs:
env:
DRIBBBLISH_VERSION: ${{ github.event.inputs.version }}
- name: Install Zip
uses: montudor/action-zip@v1
- name: Zip Release
run: zip -r DribbblishDynamic_v${{ github.event.inputs.version }}.zip *
working-directory: dist
- name: Read & Reset CHANGELOG.md
run: |
git config --global user.email "action@github.com"
git config --global user.name "actions-user"
sudo apt-get install zip
zip -r DribbblishDynamic_v${{ github.event.inputs.version }}.zip *
mv DribbblishDynamic_v${{ github.event.inputs.version }}.zip ..
- name: Read CHANGELOG.md
run: |
[ -s CHANGELOG.md ] && CHANGELOG=$(< CHANGELOG.md) || CHANGELOG="CHANGELOG=*Empty.*"
CHANGELOG=$(< CHANGELOG.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "" > CHANGELOG.md
git add CHANGELOG.md
git commit -m "Reset CHANGELOG.md"
git push
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files : true
files: dist/DribbblishDynamic_v${{ github.event.inputs.version }}.zip
files: DribbblishDynamic_v${{ github.event.inputs.version }}.zip
tag_name: ${{ github.event.inputs.version }}
draft: true
name: v${{ github.event.inputs.version }}
body: |
## Changelog