Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,6 @@ jobs:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

- name: Ensure draft GitHub Release exists
if: steps.release.outputs.release_created == 'true'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
RELEASE_TAG: ${{ steps.release.outputs.tag_name }}
run: |
set -euo pipefail
if gh release view "${RELEASE_TAG}" --json isDraft,publishedAt >/dev/null 2>&1; then
is_draft="$(gh release view "${RELEASE_TAG}" --json isDraft --jq .isDraft)"
published_at="$(gh release view "${RELEASE_TAG}" --json publishedAt --jq .publishedAt)"
if [[ "${is_draft}" == "true" && "${published_at}" == "null" ]]; then
echo "draft GitHub Release ${RELEASE_TAG} already exists"
exit 0
fi
echo "${RELEASE_TAG} exists but is not an unpublished draft." >&2
exit 1
fi
gh release create "${RELEASE_TAG}" \
--draft \
--verify-tag \
--title "${RELEASE_TAG}" \
--generate-notes

- name: Synchronize checked-in release metadata
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,24 @@ jobs:
(cd release && sha256sum wright-*.tar.gz wright-*.zip > SHA256SUMS)
ls -l release/

- name: Wait for the release-please draft Release
- name: Verify the release-please draft Release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
for attempt in $(seq 1 30); do
if gh release view "${RELEASE_TAG}" --json isDraft --jq '.isDraft' 2>/dev/null | grep -qx true; then
exit 0
fi
sleep 2
done
echo "draft GitHub Release ${RELEASE_TAG} was not found" >&2
exit 1
release="$(gh release view "${RELEASE_TAG}" \
--repo "${GITHUB_REPOSITORY}" \
--json tagName,isDraft,isImmutable,url)"
echo "${release}"
test "$(jq -r .tagName <<<"${release}")" = "${RELEASE_TAG}"
test "$(jq -r .isDraft <<<"${release}")" = "true"

- name: Attach native archives and checksums
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${RELEASE_TAG}" release/* --clobber
run: >-
gh release upload "${RELEASE_TAG}" release/* --clobber
--repo "${GITHUB_REPOSITORY}"

package-manifests:
name: Generate package-manager manifests
Expand Down Expand Up @@ -304,7 +304,9 @@ jobs:
- name: Attach package-manager manifests to the draft Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${RELEASE_TAG}" attach/* --clobber
run: >-
gh release upload "${RELEASE_TAG}" attach/* --clobber
--repo "${GITHUB_REPOSITORY}"

publish-tap:
name: Publish formula to homebrew-tap
Expand Down Expand Up @@ -411,7 +413,9 @@ jobs:
- name: Attach npm tarballs to the draft Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${RELEASE_TAG}" npm-packages/*.tgz --clobber
run: >-
gh release upload "${RELEASE_TAG}" npm-packages/*.tgz --clobber
--repo "${GITHUB_REPOSITORY}"

- name: Upload npm tarballs for registry publishing
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -525,4 +529,6 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.tag }}
run: gh release edit "${RELEASE_TAG}" --draft=false --latest
run: >-
gh release edit "${RELEASE_TAG}" --draft=false --latest
--repo "${GITHUB_REPOSITORY}"
Loading