Skip to content

Commit

Permalink
remove check for if package is already published. Simply PUT new publ…
Browse files Browse the repository at this point in the history
…ish to aptly api (#950)
  • Loading branch information
Kyle Hodgetts authored Nov 4, 2022
1 parent 7a5d1d9 commit 7e2653b
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,12 @@ jobs:
curl -u ${APTLY_USERNAME}:${PASSWORD} -X POST ${APTLY_URL}/api/repos/kusk/file/kusk?forceReplace=1
### Create snapshot
curl -u ${APTLY_USERNAME}:${PASSWORD} -X POST -H 'Content-Type: application/json' --data '{"Name":"kusk-'${VERSION}'"}' ${APTLY_URL}/api/repos/kusk/snapshots
### Publish repo
already_published=$(curl --silent -u ${APTLY_USERNAME}:${PASSWORD} ${APTLY_URL}/api/publish | jq ".[] | .Sources | .[] | .Name==\"kusk-${VERSION}\"")
if [[ -z $already_published || $already_published == *"false"* ]]; then
curl \
-u ${APTLY_USERNAME}:${PASSWORD} \
-X POST \
-H 'Content-Type: application/json' \
--data '{"Storage": "", "SourceKind": "snapshot", "Distribution": "linux", "Sources": [{"Component": "main", "Name": "kusk-'${VERSION}'"}]}' \
"${APTLY_URL}/api/publish/:kusk"
else
curl \
-u ${APTLY_USERNAME}:${PASSWORD} \
-X PUT \
-H 'Content-Type: application/json' \
--data '{"Snapshots": [{"Component": "main", "Name": "kusk-'${VERSION}'"}]}' \
"${APTLY_URL}/api/publish/:${REPO_NAME}/linux"
fi
curl \
-u ${APTLY_USERNAME}:${PASSWORD} \
-X PUT \
-H 'Content-Type: application/json' \
--data '{"Snapshots": [{"Component": "main", "Name": "kusk-'${VERSION}'"}]}' \
"${APTLY_URL}/api/publish/:${REPO_NAME}/linux"
build-and-publish-windows-installer:
needs: release
Expand Down

0 comments on commit 7e2653b

Please sign in to comment.