Create Release #1
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: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: 'The version number for the release (e.g., v1.0.0)' | |
required: true | |
default: 'v1.0.0' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Git | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Create Release Archive without docs folder | |
run: | | |
zip -r my-package-${{ github.event.inputs.release_version }}.zip . -x "docs/*" | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.release_version }} | |
release_name: ${{ github.event.inputs.release_version }} | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
files: my-package-${{ github.event.inputs.release_version }}.zip | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./my-package-${{ github.event.inputs.release_version }}.zip | |
asset_name: my-package-${{ github.event.inputs.release_version }}.zip | |
asset_content_type: application/zip | |