Skip to content

Commit

Permalink
Fix latest release by moving make_latest (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKalke authored Feb 13, 2024
1 parent 369881e commit ebcb038
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/scripts/create_draft_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set -E # needs to be set if we want the ERR trap
set -o pipefail # prevents errors in a pipeline from being masked

RELEASE_TAG=$1
IS_LATEST_RELEASE=$2

REPOSITORY=${REPOSITORY:-kyma-project/serverless-manager}
GITHUB_URL=https://api.github.com/repos/${REPOSITORY}
Expand All @@ -20,13 +19,11 @@ JSON_PAYLOAD=$(jq -n \
--arg tag_name "$RELEASE_TAG" \
--arg name "$RELEASE_TAG" \
--arg body "$CHANGELOG_FILE" \
--arg is_latest "$IS_LATEST_RELEASE" \
'{
"tag_name": $tag_name,
"name": $name,
"body": $body,
"draft": true,
"make_latest": $is_latest
"draft": true
}')

CURL_RESPONSE=$(curl -L \
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/publish_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -E # needs to be set if we want the ERR trap
set -o pipefail # prevents errors in a pipeline from being masked

RELEASE_ID=$1
IS_LATEST_RELEASE=$2

REPOSITORY=${REPOSITORY:-kyma-project/serverless-manager}
GITHUB_URL=https://api.github.com/repos/${REPOSITORY}
Expand All @@ -20,4 +21,4 @@ CURL_RESPONSE=$(curl -L \
-H "${GITHUB_AUTH_HEADER}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
${GITHUB_URL}/releases/${RELEASE_ID} \
-d '{"draft": false}')
-d '{"draft": false, "make_latest": '"$IS_LATEST_RELEASE"'}')
4 changes: 2 additions & 2 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_ID=$(./.github/scripts/create_draft_release.sh ${{ github.event.inputs.name }} ${{ github.event.inputs.latest_release }})
RELEASE_ID=$(./.github/scripts/create_draft_release.sh ${{ github.event.inputs.name }})
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Create lightweight tag
Expand Down Expand Up @@ -122,4 +122,4 @@ jobs:
- name: Publish release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.github/scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }}
run: ./.github/scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }} ${{ github.event.inputs.latest_release }}

0 comments on commit ebcb038

Please sign in to comment.