automatic fetch forgetool during ci
This commit is contained in:
@@ -60,22 +60,35 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install ./forgetool
|
- name: Setup Forgetool
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
env:
|
||||||
VERSION="4.0.0-ALPHA23"
|
GITHUB_TOKEN: ${{ inputs.token }}
|
||||||
FILENAME="forgetool_${VERSION}_linux_amd64.tar.gz"
|
run: |-
|
||||||
URL="https://github.com/trueforge-org/forgetool/releases/download/v${VERSION}/${FILENAME}"
|
TAG=""
|
||||||
|
if RELEASES_JSON="$(curl -fsSL \
|
||||||
|
https://api.github.com/repos/trueforge-org/forgetool/releases)"; then
|
||||||
|
TAG="$(jq -r '[.[]
|
||||||
|
| select(.prerelease == true)
|
||||||
|
| .tag_name
|
||||||
|
| select(test("^(forgetool-)?v[0-9]+\\.[0-9]+\\.[0-9]+-ALPHA[0-9]+$"))
|
||||||
|
| {tag: ., alpha: (capture("ALPHA(?<n>[0-9]+)$").n | tonumber)}
|
||||||
|
] | if length > 0 then max_by(.alpha).tag else empty end' <<< "${RELEASES_JSON}")"
|
||||||
|
fi
|
||||||
|
[ -n "${TAG}" ] && [ "${TAG}" != "null" ] || TAG="v4.0.0-ALPHA24"
|
||||||
|
VERSION="${TAG#v}"
|
||||||
|
VERSION="${VERSION#forgetool-v}"
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64) ARCH="amd64" ;;
|
||||||
|
aarch64) ARCH="arm64" ;;
|
||||||
|
*) echo "Unsupported uname architecture: $(uname -m). Supported uname values: x86_64, aarch64." && exit 1 ;;
|
||||||
|
esac
|
||||||
|
curl -fsSL -o "${RUNNER_TEMP}/forgetool.tar.gz" "https://github.com/trueforge-org/forgetool/releases/download/${TAG}/forgetool_${VERSION}_linux_${ARCH}.tar.gz" || { echo "Failed to download forgetool release ${TAG} for linux_${ARCH}"; exit 1; }
|
||||||
|
mkdir -p "${RUNNER_TEMP}/forgetool-bin"
|
||||||
|
tar -xzf "${RUNNER_TEMP}/forgetool.tar.gz" -C "${RUNNER_TEMP}/forgetool-bin" forgetool || { echo "Failed to extract forgetool binary from archive"; exit 1; }
|
||||||
|
chmod +x "${RUNNER_TEMP}/forgetool-bin/forgetool"
|
||||||
|
echo "${RUNNER_TEMP}/forgetool-bin" >> "${GITHUB_PATH}"
|
||||||
|
|
||||||
mkdir -p temp
|
|
||||||
cd temp
|
|
||||||
# Download the archive
|
|
||||||
curl -L -o "$FILENAME" "$URL"
|
|
||||||
|
|
||||||
# Extract the archive
|
|
||||||
tar -xzf "$FILENAME"
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
- name: Get Changelog Format Version
|
- name: Get Changelog Format Version
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -113,7 +126,7 @@ jobs:
|
|||||||
gunzip "$JSON_FILE.gz" --force # Force overwrite if file already exists
|
gunzip "$JSON_FILE.gz" --force # Force overwrite if file already exists
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./temp/forgetool charts genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR"
|
forgetool charts genchangelog "$REPO_PATH" "$TEMPLATE_PATH" "$OUTPUT_DIR"
|
||||||
|
|
||||||
# TODO: Test remove later
|
# TODO: Test remove later
|
||||||
echo "temp content:"
|
echo "temp content:"
|
||||||
@@ -195,7 +208,7 @@ jobs:
|
|||||||
mkdir -p website/truecharts/public/img/hotlink-ok/chart-icons-small || echo "chart-icons-small path already exists, continuing..."
|
mkdir -p website/truecharts/public/img/hotlink-ok/chart-icons-small || echo "chart-icons-small path already exists, continuing..."
|
||||||
mkdir -p website/truecharts/src/assets || echo "assets path already exists, continuing..."
|
mkdir -p website/truecharts/src/assets || echo "assets path already exists, continuing..."
|
||||||
|
|
||||||
./temp/forgetool charts genchartlist ./charts
|
forgetool charts genchartlist ./charts
|
||||||
mv -f charts.json website/truecharts/src/assets/charts.json
|
mv -f charts.json website/truecharts/src/assets/charts.json
|
||||||
mv -f ./website/truecharts/src/content/docs/truetech/truecharts/charts/description-list.mdx ./description-list.mdx
|
mv -f ./website/truecharts/src/content/docs/truetech/truecharts/charts/description-list.mdx ./description-list.mdx
|
||||||
echo "Copying changelogs to docs"
|
echo "Copying changelogs to docs"
|
||||||
|
|||||||
Reference in New Issue
Block a user