Version Upped #6
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set Tag as Filename | |
id: tag_name | |
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Create ZIP file | |
run: zip -r "${{ env.TAG_NAME }}.zip" . | |
- name: Generate Changelog | |
id: generate_changelog | |
run: | | |
# Get the list of commit messages since the last tag | |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^) | |
echo -e "# Changelog\n" > CHANGELOG.md | |
git log ${PREV_TAG}..HEAD --pretty=format:"* %s" >> CHANGELOG.md | |
# Get the list of contributors for these commits | |
echo -e "\n\n# Contributors\n" >> CHANGELOG.md | |
git log ${PREV_TAG}..HEAD --format='%aN' | sort -u | awk '{print "* " $0}' >> CHANGELOG.md | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
body_path: ./CHANGELOG.md # Use the generated changelog as release notes | |
- name: Upload Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.TAG_NAME }}.zip | |
asset_name: source.zip | |
asset_content_type: application/zip |