Automated Release with Archive #6
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: Automated Release with Archive | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag Name for Release (leave empty for last tag)' | |
required: false | |
default: '' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Determine tag | |
id: last_tag | |
run: | | |
echo "LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV | |
- name: Create archive | |
run: | | |
if [ -z "${{ github.event.inputs.tag }}" ]; then | |
TAG_NAME=${{ env.LAST_TAG }} | |
else | |
TAG_NAME=${{ github.event.inputs.tag }} | |
fi | |
zip -r ${TAG_NAME}.zip . | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.LAST_TAG }} | |
name: Release ${{ env.LAST_TAG }} | |
files: ./*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |