forked from Mirrors/OmniNX
modified workflow
This commit is contained in:
parent
7ef0c5fe49
commit
bfbe313c57
2 changed files with 24 additions and 103 deletions
24
.github/workflows/build-all.yml
vendored
Normal file
24
.github/workflows/build-all.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: Build All
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build all variants
|
||||
run: bash scripts/build-all.sh
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: omninx-packs-${{ github.sha }}
|
||||
path: output/*.zip
|
||||
103
.github/workflows/build-packs.yml
vendored
103
.github/workflows/build-packs.yml
vendored
|
|
@ -1,103 +0,0 @@
|
|||
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 }}
|
||||
Loading…
Reference in a new issue