mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-06 13:40:00 +00:00
Wrapping the version-check block in a do…end indented every constant by two spaces, so the sed pattern's ^local anchor stopped matching and the followup grep returned exit 1, killing the step under bash -e. Captures the leading whitespace into \1 so the indent is preserved through the substitution, and matches the two-space alignment between LATEST and = so we don't accidentally hit LATEST_URL on the line below.
35 lines
982 B
YAML
35 lines
982 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 = [0-9]*/\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 }}
|