Run release build CI on main and support source refs
This commit is contained in:
@@ -2,14 +2,20 @@ name: Build and publish release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_tag:
|
||||
description: 'Existing Git tag to publish'
|
||||
description: 'GitHub Release tag to publish'
|
||||
required: true
|
||||
default: '0.7.3'
|
||||
source_ref:
|
||||
description: 'Source branch/tag/commit to compile'
|
||||
required: true
|
||||
default: 'main'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -24,20 +30,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Resolve release tag
|
||||
- name: Resolve build metadata
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
||||
echo "RELEASE_TAG=${{ inputs.release_tag }}" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "SOURCE_DESCRIPTION=${{ inputs.source_ref }}" >> "$GITHUB_ENV"
|
||||
elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||
echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
|
||||
echo "SOURCE_DESCRIPTION=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "RELEASE_TAG=dev" >> "$GITHUB_ENV"
|
||||
echo "SOURCE_DESCRIPTION=${GITHUB_SHA}" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Checkout release tag
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || github.ref }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Zig
|
||||
@@ -56,6 +67,7 @@ jobs:
|
||||
-Ddpslog=true
|
||||
|
||||
- name: Collect release DLLs
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -87,6 +99,7 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Add custom WeirdPerformance v0.7.3
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -120,6 +133,7 @@ jobs:
|
||||
PY
|
||||
|
||||
- name: Create checksums and ZIP
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -130,6 +144,7 @@ jobs:
|
||||
zip -j "WeirdUtils-${RELEASE_TAG}.zip" release/*.dll release/SHA256SUMS.txt
|
||||
|
||||
- name: Publish GitHub Release
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
@@ -139,9 +154,9 @@ jobs:
|
||||
cat > release-notes.md <<EOF
|
||||
WeirdUtils ${RELEASE_TAG}
|
||||
|
||||
- Standard module DLLs are compiled from Git tag `${RELEASE_TAG}` with Zig ${ZIG_VERSION} in ReleaseSmall mode.
|
||||
- Standard module DLLs are compiled from `${SOURCE_DESCRIPTION}` with Zig ${ZIG_VERSION} in ReleaseSmall mode.
|
||||
- The upstream WeirdPerformance variant is intentionally excluded.
|
||||
- `weirdperformance.dll` is the custom Dusk-92 v${CUSTOM_WEIRDPERFORMANCE_TAG} build, copied from the Codeberg release with the same version.
|
||||
- `weirdperformance.dll` is the custom Dusk-92 v${CUSTOM_WEIRDPERFORMANCE_TAG} build from the Codeberg release.
|
||||
- `SHA256SUMS.txt` is included for integrity checks.
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user