mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-24 00:26:55 +00:00
63f9b26d91
Replaces the 99999999 sentinel with `LATEST = MIN`. The elseif `< LATEST` then reduces to `< MIN` on source builds, which the preceding `if` branch always catches first — so the soft-nudge never fires for unpinned installs. No explicit guard needed. A source/cloned install previously showed "ClassicAPI v9999.99.99 is available" because the sentinel leaked into FormatVersion before the release workflow could patch it. With this layout, source installs are silent and only properly-pinned release zips trigger the nudge. Workflow sed broadens to "= .*" so it overwrites the line regardless of whether the RHS is a digit string or a Lua identifier.
35 lines
978 B
YAML
35 lines
978 B
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Pin ClassicAPI latest version to current release
|
|
run: |
|
|
LATEST=$(gh api repos/brues-code/ClassicAPI/releases/latest --jq .tag_name | tr -d v)
|
|
IFS=. read -r MAJOR MINOR PATCH <<<"$LATEST"
|
|
PACKED=$((MAJOR * 10000 + MINOR * 100 + PATCH))
|
|
echo "Pinning PFUI_CLASSIC_API_LATEST to $LATEST ($PACKED)"
|
|
sed -i "s/^\([[:space:]]*\)local PFUI_CLASSIC_API_LATEST = .*/\1local PFUI_CLASSIC_API_LATEST = $PACKED/" pfUI.lua
|
|
grep 'local PFUI_CLASSIC_API_' pfUI.lua
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Package and release to GitHub
|
|
uses: BigWigsMods/packager@v2
|
|
env:
|
|
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
|