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
14 changes: 11 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
required: true
type: number
expected_version:
description: "Version to release, without the v prefix"
description: "Version to release, with or without the v prefix"
required: true
type: string

Expand All @@ -32,6 +32,7 @@ jobs:
outputs:
merge_commit_sha: ${{ steps.release-pr.outputs.merge_commit_sha }}
is_prerelease: ${{ steps.release-pr.outputs.is_prerelease }}
expected_version: ${{ steps.release-pr.outputs.expected_version }}
env:
EXPECTED_VERSION: ${{ inputs.expected_version }}
steps:
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
exit 1
fi

EXPECTED_VERSION="${EXPECTED_VERSION#v}"
if [[ ! "${EXPECTED_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
echo "Expected version must be a valid semver version." >&2
exit 1
Expand Down Expand Up @@ -136,10 +138,12 @@ jobs:
echo "MERGE_COMMIT_SHA=${merge_commit_sha}" >>"${GITHUB_ENV}"
echo "merge_commit_sha=${merge_commit_sha}" >>"${GITHUB_OUTPUT}"
echo "is_prerelease=${is_prerelease}" >>"${GITHUB_OUTPUT}"
echo "EXPECTED_VERSION=${EXPECTED_VERSION}" >>"${GITHUB_ENV}"
echo "expected_version=${EXPECTED_VERSION}" >>"${GITHUB_OUTPUT}"

- name: Verify master and crate versions
env:
EXPECTED_VERSION: ${{ inputs.expected_version }}
EXPECTED_VERSION: ${{ steps.release-pr.outputs.expected_version }}
run: |
git fetch --no-tags origin +refs/heads/master:refs/remotes/origin/master "${MERGE_COMMIT_SHA}"
master_sha="$(git rev-parse refs/remotes/origin/master)"
Expand Down Expand Up @@ -193,8 +197,9 @@ jobs:
id-token: write
env:
MERGE_COMMIT_SHA: ${{ needs.validate.outputs.merge_commit_sha }}
EXPECTED_VERSION: ${{ inputs.expected_version }}
EXPECTED_VERSION: ${{ needs.validate.outputs.expected_version }}
IS_PRERELEASE: ${{ needs.validate.outputs.is_prerelease }}
CRATES_IO_USER_AGENT: cloudflare-boring-release/1.0 (https://github.com/cloudflare/boring)
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
Expand Down Expand Up @@ -259,12 +264,14 @@ jobs:

crate_status() {
curl --silent --show-error --retry 3 --retry-all-errors \
--user-agent "${CRATES_IO_USER_AGENT}" \
--output /dev/null --write-out '%{http_code}' \
"https://crates.io/api/v1/crates/${1}/${EXPECTED_VERSION}"
}

crate_info() {
curl --silent --show-error --retry 3 --retry-all-errors \
--user-agent "${CRATES_IO_USER_AGENT}" \
"https://crates.io/api/v1/crates/${1}/${EXPECTED_VERSION}"
}

Expand Down Expand Up @@ -322,6 +329,7 @@ jobs:
index_path="$(crate_index_path "${1}")"
for delay in 0 5 10 20 40; do
if curl --silent --show-error --retry 3 --retry-all-errors \
--user-agent "${CRATES_IO_USER_AGENT}" \
"https://index.crates.io/${index_path}" \
| jq -s -e --arg version "${EXPECTED_VERSION}" "any(.[]; .vers == \$version)" >/dev/null; then
return 0
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
target/
Cargo.lock
.idea/
*.iml
.vscode/
.DS_Store
.DS_Store
282 changes: 282 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading