minor tweaks to release workflow
This commit is contained in:
1 parent
3f68af6f3a
commit
3bd4af24fa
3 files changed
+13
-9
No files matched your search
@@ -3,11 +3,11 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
- "grok-dev@*"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Release version to publish (for example v1.1.4)"
|
||||
description: "Release tag to publish (for example grok-dev@1.1.4)"
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
@@ -88,8 +88,7 @@ jobs:
|
||||
else
|
||||
tag="${{ github.ref_name }}"
|
||||
fi
|
||||
tag="${tag#v}"
|
||||
echo "RELEASE_TAG=v${tag}" >> "$GITHUB_ENV"
|
||||
echo "RELEASE_TAG=${tag}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Download all build artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
+6
-4
@@ -227,14 +227,16 @@ maybe_update_path() {
|
||||
|
||||
resolve_release_version() {
|
||||
if [[ -n "$requested_version" ]]; then
|
||||
RESOLVED_VERSION="${requested_version#v}"
|
||||
RELEASE_BASE_URL="https://github.com/${REPO}/releases/download/v${RESOLVED_VERSION}"
|
||||
RESOLVED_VERSION="${requested_version}"
|
||||
RELEASE_BASE_URL="https://github.com/${REPO}/releases/download/grok-dev@${RESOLVED_VERSION}"
|
||||
return
|
||||
fi
|
||||
|
||||
RESOLVED_VERSION=$(curl -fsSL "${RELEASES_API}/latest" \
|
||||
| sed -n 's/.*"tag_name":[[:space:]]*"v\{0,1\}\([^"]*\)".*/\1/p' \
|
||||
local tag
|
||||
tag=$(curl -fsSL "${RELEASES_API}/latest" \
|
||||
| sed -n 's/.*"tag_name":[[:space:]]*"\([^"]*\)".*/\1/p' \
|
||||
| head -n 1)
|
||||
RESOLVED_VERSION="${tag#grok-dev@}"
|
||||
if [[ -z "$RESOLVED_VERSION" ]]; then
|
||||
echo "Failed to resolve the latest Grok release version." >&2
|
||||
exit 1
|
||||
|
||||
@@ -332,7 +332,10 @@ async function fetchReleaseJson(url: string): Promise<GitHubRelease | null> {
|
||||
}
|
||||
|
||||
function normalizeReleaseVersion(tagName: string): string | null {
|
||||
return semverValid(tagName.startsWith("v") ? tagName.slice(1) : tagName);
|
||||
let version = tagName;
|
||||
if (version.startsWith("grok-dev@")) version = version.slice("grok-dev@".length);
|
||||
if (version.startsWith("v")) version = version.slice(1);
|
||||
return semverValid(version);
|
||||
}
|
||||
|
||||
async function downloadBinary(url: string, dest: string): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user