fix(ci): switch release composite actions to unstable on non-tag builds
The release-binaries and release-os-package composite actions were comparing the raw release-version input against the literal "main" to decide whether to use "unstable" for filenames and the S3 directory. Callers always pass `steps.ghd.outputs.describe`, which is a value like `v2.3.0-408-ge053d317` on non-tag builds — so the check never fired and unstable artifacts landed under `/<project>/<describe>/` with `<project>-<describe>-...` filenames. Drive the switch from `github.ref_type == 'tag'` instead, matching the pattern the desktop and config-yaml jobs in release.yml already use. The raw describe value still flows into RELEASE_VERSION so the binary and package metadata keep the precise commit reference.
This commit is contained in:
parent
e053d3172f
commit
4f8a44de89
|
|
@ -12,7 +12,11 @@ inputs:
|
||||||
description: 'Which project to build: "vikunja" or "veans".'
|
description: 'Which project to build: "vikunja" or "veans".'
|
||||||
required: true
|
required: true
|
||||||
release-version:
|
release-version:
|
||||||
description: 'Raw git describe value (e.g. v1.2.3 or a sha). Use "" or "main" for unstable builds.'
|
description: |
|
||||||
|
Raw git describe value (e.g. v1.2.3 or v2.3.0-408-ge053d317). Always
|
||||||
|
passed through to the build so the binary embeds the precise commit.
|
||||||
|
Filenames and the S3 directory use "unstable" instead whenever
|
||||||
|
github.ref_type isn't "tag".
|
||||||
required: true
|
required: true
|
||||||
# Secrets — composite actions can't read the `secrets` context directly, so
|
# Secrets — composite actions can't read the `secrets` context directly, so
|
||||||
# the caller threads them through as inputs.
|
# the caller threads them through as inputs.
|
||||||
|
|
@ -39,6 +43,7 @@ runs:
|
||||||
env:
|
env:
|
||||||
PROJECT: ${{ inputs.project }}
|
PROJECT: ${{ inputs.project }}
|
||||||
RELEASE_VERSION_INPUT: ${{ inputs.release-version }}
|
RELEASE_VERSION_INPUT: ${{ inputs.release-version }}
|
||||||
|
VERSION_OR_UNSTABLE: ${{ github.ref_type == 'tag' && inputs.release-version || 'unstable' }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
@ -50,13 +55,6 @@ runs:
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# version-or-unstable: real version unless empty/"main", in which case "unstable".
|
|
||||||
if [ -z "$RELEASE_VERSION_INPUT" ] || [ "$RELEASE_VERSION_INPUT" = "main" ]; then
|
|
||||||
version_or_unstable="unstable"
|
|
||||||
else
|
|
||||||
version_or_unstable="$RELEASE_VERSION_INPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$PROJECT" in
|
case "$PROJECT" in
|
||||||
vikunja)
|
vikunja)
|
||||||
output_dir="."
|
output_dir="."
|
||||||
|
|
@ -71,11 +69,11 @@ runs:
|
||||||
{
|
{
|
||||||
echo "PROJECT=$PROJECT"
|
echo "PROJECT=$PROJECT"
|
||||||
echo "RELEASE_VERSION=$RELEASE_VERSION_INPUT"
|
echo "RELEASE_VERSION=$RELEASE_VERSION_INPUT"
|
||||||
echo "VERSION_OR_UNSTABLE=$version_or_unstable"
|
echo "VERSION_OR_UNSTABLE=$VERSION_OR_UNSTABLE"
|
||||||
echo "XGO_OUT_NAME=${PROJECT}-${version_or_unstable}"
|
echo "XGO_OUT_NAME=${PROJECT}-${VERSION_OR_UNSTABLE}"
|
||||||
echo "OUTPUT_DIR=$output_dir"
|
echo "OUTPUT_DIR=$output_dir"
|
||||||
echo "DIST_PREFIX=$dist_prefix"
|
echo "DIST_PREFIX=$dist_prefix"
|
||||||
echo "S3_TARGET_PATH=/${PROJECT}/${version_or_unstable}"
|
echo "S3_TARGET_PATH=/${PROJECT}/${VERSION_OR_UNSTABLE}"
|
||||||
echo "ARTIFACT_BINARIES_NAME=${PROJECT}_bins"
|
echo "ARTIFACT_BINARIES_NAME=${PROJECT}_bins"
|
||||||
echo "ARTIFACT_ZIPS_NAME=${PROJECT}_bin_packages"
|
echo "ARTIFACT_ZIPS_NAME=${PROJECT}_bin_packages"
|
||||||
} >> "$GITHUB_ENV"
|
} >> "$GITHUB_ENV"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,11 @@ inputs:
|
||||||
description: 'Project name (vikunja | veans). Drives all derived paths.'
|
description: 'Project name (vikunja | veans). Drives all derived paths.'
|
||||||
required: true
|
required: true
|
||||||
release-version:
|
release-version:
|
||||||
description: 'RELEASE_VERSION env value — the same version that ended up in the binaries artifact. Empty or "main" maps to "unstable".'
|
description: |
|
||||||
|
RELEASE_VERSION env value — the same version that ended up in the
|
||||||
|
binaries artifact. Always embedded in the package metadata via
|
||||||
|
nfpm; filenames and the S3 directory use "unstable" instead
|
||||||
|
whenever github.ref_type isn't "tag".
|
||||||
required: true
|
required: true
|
||||||
packager:
|
packager:
|
||||||
description: 'nfpm packager: rpm | deb | apk | archlinux.'
|
description: 'nfpm packager: rpm | deb | apk | archlinux.'
|
||||||
|
|
@ -51,6 +55,7 @@ runs:
|
||||||
env:
|
env:
|
||||||
PROJECT: ${{ inputs.project }}
|
PROJECT: ${{ inputs.project }}
|
||||||
RELEASE_VERSION: ${{ inputs.release-version }}
|
RELEASE_VERSION: ${{ inputs.release-version }}
|
||||||
|
VERSION_OR_UNSTABLE: ${{ github.ref_type == 'tag' && inputs.release-version || 'unstable' }}
|
||||||
PACKAGER: ${{ inputs.packager }}
|
PACKAGER: ${{ inputs.packager }}
|
||||||
PKG_ARCH: ${{ inputs.pkg-arch }}
|
PKG_ARCH: ${{ inputs.pkg-arch }}
|
||||||
GO_NAME: ${{ inputs.go-name }}
|
GO_NAME: ${{ inputs.go-name }}
|
||||||
|
|
@ -76,17 +81,12 @@ runs:
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z "$RELEASE_VERSION" ] || [ "$RELEASE_VERSION" = "main" ]; then
|
echo "VERSION_OR_UNSTABLE=$VERSION_OR_UNSTABLE" >> "$GITHUB_ENV"
|
||||||
version_or_unstable="unstable"
|
|
||||||
else
|
|
||||||
version_or_unstable="$RELEASE_VERSION"
|
|
||||||
fi
|
|
||||||
echo "VERSION_OR_UNSTABLE=$version_or_unstable" >> "$GITHUB_ENV"
|
|
||||||
echo "BINARIES_ARTIFACT_NAME=${PROJECT}_bins" >> "$GITHUB_ENV"
|
echo "BINARIES_ARTIFACT_NAME=${PROJECT}_bins" >> "$GITHUB_ENV"
|
||||||
echo "BINARY_GLOB=${PROJECT}-*-${GO_NAME}" >> "$GITHUB_ENV"
|
echo "BINARY_GLOB=${PROJECT}-*-${GO_NAME}" >> "$GITHUB_ENV"
|
||||||
echo "PACKAGE_FILENAME=${PROJECT}-${version_or_unstable}-${PKG_ARCH}.${PACKAGER}" >> "$GITHUB_ENV"
|
echo "PACKAGE_FILENAME=${PROJECT}-${VERSION_OR_UNSTABLE}-${PKG_ARCH}.${PACKAGER}" >> "$GITHUB_ENV"
|
||||||
echo "ARTIFACT_NAME=${PROJECT}_os_package_${PACKAGER}_${PKG_ARCH}" >> "$GITHUB_ENV"
|
echo "ARTIFACT_NAME=${PROJECT}_os_package_${PACKAGER}_${PKG_ARCH}" >> "$GITHUB_ENV"
|
||||||
echo "S3_TARGET_PATH=/${PROJECT}/${version_or_unstable}" >> "$GITHUB_ENV"
|
echo "S3_TARGET_PATH=/${PROJECT}/${VERSION_OR_UNSTABLE}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Download project binaries
|
- name: Download project binaries
|
||||||
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue