Skip to content

Commit

Permalink
add workflow for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Cockroft committed Dec 6, 2024
1 parent b3d73f2 commit 6683db8
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Release for Batch Asset Importer

on:
push:
tags:
- 'v*' # Trigger only when a tag starting with 'v' is pushed (e.g., v1.0.0, v2.3.4)

jobs:
release:
name: Build and Release
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3

# Step 2: Extract the version from the tag
- name: Extract Version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

# Step 3: Zip the `batch_asset_importer` folder with version in filename
- name: Zip the Addon
run: |
mkdir release
cp -r batch_asset_importer release/
cd release
zip -r "batch_asset_importer_${VERSION}.zip" batch_asset_importer/
# Step 4: Upload the ZIP as a GitHub Release Asset
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: release/batch_asset_importer_${{ env.VERSION }}.zip # Path to the ZIP file with version
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }} # Use the tag that triggered the workflow
name: Release ${{ github.ref_name }} # Name the release after the tag
body: |
**Batch Asset Importer Addon**
- Automatically generated release for version ${{ github.ref_name }}

0 comments on commit 6683db8

Please sign in to comment.