From e51b22da510e3a571e7f2a572198ea118c6d6ba9 Mon Sep 17 00:00:00 2001 From: Philipp Sauter Date: Thu, 21 Sep 2023 12:33:56 +0200 Subject: [PATCH] wip --- .goreleaser.yml | 3 +++ publish-artifact.sh | 33 ++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 5bbe5790..84fde9de 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -116,6 +116,9 @@ nfpms: publishers: - name: aptly + env: + - AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }} + - AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }} ids: - nfpms cmd: ./publish-artifact.sh {{ .ArtifactPath }} diff --git a/publish-artifact.sh b/publish-artifact.sh index 2261113a..5d4f313c 100755 --- a/publish-artifact.sh +++ b/publish-artifact.sh @@ -11,28 +11,35 @@ aptlydistro=stable aptlycmd="aptly -config=.aptly.conf" gpgkeyflag='-gpg-key=7100E8BFD6199CE0374CB7F003686F8CDE378D41' -if $aptlycmd mirror show $aptlymirror >/dev/null 2>&1; then - echo "repo $aptlymirror already exists" -else - $aptlycmd mirror create \ - $aptlymirror \ - $archiveurl \ - $aptlydistro -fi +# if $aptlycmd mirror show $aptlymirror >/dev/null 2>&1; then +# echo "repo $aptlymirror already exists" +# else +# $aptlycmd mirror create \ +# -filter="(latest)" \ +# $aptlymirror \ +# $archiveurl \ +# $aptlydistro +# fi -$aptlycmd mirror update \ - $aptlymirror +# $aptlycmd mirror update \ +# $aptlymirror if $aptlycmd repo show $aptlyrepo >/dev/null 2>&1; then echo "repo $aptlyrepo already exists" else - $aptlycmd repo import $aptlymirror $aptlyrepo $aptlydistro + $aptlycmd repo create $aptlyrepo + # $aptlycmd repo import $aptlymirror $aptlyrepo $aptlydistro fi if echo $artifact | grep -q '.*.deb'; then $aptlycmd repo add $aptlyrepo $artifact - $aptlycmd publish update \ + $aptlycmd publish repo \ $gpgkeyflag \ - $aptlydistro \ + -distribution=$aptlydistro \ + $aptlyrepo \ $aptlyremote + # $aptlycmd publish update \ + # $gpgkeyflag \ + # $aptlydistro \ + # $aptlyremote fi