build: update release action #4
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
# Create a release build .zip of the (filtered) contents of the main branch | |
# When a new tag is pushed with a semantic versioning format and _stable suffix | |
name: ZIP Addon Release Build | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository under a subdirectory (repository-name/) to | |
# make zipping easier. Note: 'gh' or 'git' commands must be executed | |
# *after* changing into the repository's directory. | |
# Set branch to main | |
- uses: actions/checkout@v3 | |
with: | |
ref: "main" | |
path: ${{ github.event.repository.name }} | |
# Create a filtered zip of the repository. | |
- name: Zip Repository (excludes .git*) | |
run: | | |
zip -r ${{ github.event.repository.name }}_${{github.ref_name}}.zip \ | |
${{ github.event.repository.name }} \ | |
-x "${{ github.event.repository.name }}/.git*" \ | |
-x "${{ github.event.repository.name }}/.github/*" \ | |
-x "${{ github.event.repository.name }}/.vs/*" \ | |
-x "${{ github.event.repository.name }}/.vscode/*" \ | |
-x "${{ github.event.repository.name }}/README.md" \ | |
-x "${{ github.event.repository.name }}/working_files/*" | |
# Create a new GitHub release using the tag name or commit id. | |
- name: Create versioned build with filtered zip file. | |
run: | | |
cd ${{ github.event.repository.name }} | |
gh release create ${{github.ref_name}} --generate-notes \ | |
../${{ github.event.repository.name }}_${{github.ref_name}}.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |