Skip to content

Commit 8aa64d5

Browse files
author
Joe Doss
committed
Move package import logic into package-repo-import.sh and use IS_PRERELEASE.
1 parent 35525cb commit 8aa64d5

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ jobs:
6868
id-token: write
6969
contents: write
7070
packages: write
71-
uses: smallstep/workflows/.github/workflows/goreleaser.yml@main
71+
uses: smallstep/workflows/.github/workflows/goreleaser.yml@jdoss/PRERELEASE_env_var
7272
with:
7373
enable-packages-upload: true
74+
is_prerelease: ${{ needs.create_release.outputs.is_prerelease }}
7475
secrets: inherit
7576

7677
build_upload_docker:

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ before:
1313

1414
after:
1515
hooks:
16+
# This script depends on IS_PRERELEASE env being set. This is set by CI in the Is Pre-release step.
1617
- cmd: bash scripts/package-repo-import.sh {{ .Var.packageName }} {{ .Version }}
1718
output: true
1819

@@ -161,7 +162,6 @@ publishers:
161162
ids:
162163
- packages
163164
cmd: ./scripts/package-upload.sh {{ abs .ArtifactPath }} {{ .Var.packageName }} {{ .Version }} {{ .Var.packageRelease }}
164-
disable: "{{ if .Prerelease }}true{{ end }}"
165165

166166
snapshot:
167167
name_template: "{{ .Tag }}-next"

scripts/package-repo-import.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ if [[ ${GORELEASER_PHASE} != "publish" ]]; then
4545
exit 0;
4646
fi
4747

48+
if [[ ${IS_PRERELEASE} == "true" ]]; then
49+
echo "Skipping artifact import; IS_PRERELEASE is 'true'"
50+
exit 0;
51+
fi
52+
4853
check_package "${GCLOUD_RPM_REPO}" "${EPOCH}:${VERSION}-${RELEASE}"
4954
gcloud artifacts yum import "${GCLOUD_RPM_REPO}" \
5055
--location "${GCLOUD_LOCATION}" \

0 commit comments

Comments
 (0)