-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Greg Cockroft
committed
Dec 6, 2024
1 parent
b3d73f2
commit 6683db8
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} | ||