forked from Mirrors/OmniNX
103 lines
No EOL
3.4 KiB
YAML
103 lines
No EOL
3.4 KiB
YAML
name: Build OmniNX Packs
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*.*.*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version number (e.g., 1.0.0)'
|
|
required: true
|
|
default: '1.0.0'
|
|
hotfix:
|
|
description: 'Hotfix mode - update existing release instead of creating new one'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
hotfix_tag:
|
|
description: 'Tag of existing release to update (required if hotfix is true)'
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # Required to create releases and tags
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true # Checkout LFS files needed for build
|
|
|
|
- name: Set version from tag
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
echo "Version from tag: $VERSION"
|
|
|
|
- name: Set version from input
|
|
if: github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
|
echo "HOTFIX=${{ github.event.inputs.hotfix }}" >> $GITHUB_ENV
|
|
echo "HOTFIX_TAG=${{ github.event.inputs.hotfix_tag }}" >> $GITHUB_ENV
|
|
echo "Version from input: ${{ github.event.inputs.version }}"
|
|
if [ "${{ github.event.inputs.hotfix }}" == "true" ]; then
|
|
echo "Hotfix mode: Will update release with tag ${{ github.event.inputs.hotfix_tag }}"
|
|
fi
|
|
|
|
- name: Make build scripts executable
|
|
run: |
|
|
chmod +x scripts/build-pack.sh
|
|
chmod +x scripts/build-all.sh
|
|
|
|
- name: Build all variants
|
|
run: |
|
|
./scripts/build-all.sh $VERSION
|
|
|
|
- name: Create release artifacts
|
|
run: |
|
|
mkdir -p release
|
|
cp output/*.zip release/ || true
|
|
|
|
- name: Set release tag name
|
|
id: set_tag
|
|
run: |
|
|
if [ "${{ env.HOTFIX }}" == "true" ] && [ -n "${{ env.HOTFIX_TAG }}" ]; then
|
|
# Hotfix mode: use the specified tag
|
|
echo "tag=${{ env.HOTFIX_TAG }}" >> $GITHUB_OUTPUT
|
|
echo "mode=update" >> $GITHUB_OUTPUT
|
|
elif [ -n "${{ github.ref_name }}" ]; then
|
|
# Tag push: use the tag
|
|
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
echo "mode=create" >> $GITHUB_OUTPUT
|
|
else
|
|
# Manual run (non-hotfix): create new tag
|
|
echo "tag=${{ env.VERSION }}" >> $GITHUB_OUTPUT
|
|
echo "mode=create" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Create or Update GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ steps.set_tag.outputs.tag }}
|
|
name: OmniNX Release ${{ env.VERSION }}
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: false
|
|
files: |
|
|
release/OmniNX-Standard-${{ env.VERSION }}.zip
|
|
release/OmniNX-Light-${{ env.VERSION }}.zip
|
|
release/OmniNX-OC-${{ env.VERSION }}.zip
|
|
body: |
|
|
## Changelog
|
|
|
|
See the [changelog](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
|
|
|
|
${{ steps.set_tag.outputs.mode == 'update' && '**Hotfix Update** - This release has been updated with new builds.' || '' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |