mirror of
https://github.com/larksuite/cli.git
synced 2026-08-03 08:32:46 +08:00
Compare commits
7 Commits
v1.0.79-be
...
v1.0.78-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83dbf6eae0 | ||
|
|
bf40df896f | ||
|
|
b65f977d9c | ||
|
|
cb9fc32717 | ||
|
|
ac0fb6d807 | ||
|
|
fc2ddf2bf5 | ||
|
|
51165e4f6a |
52
.github/workflows/macos-release-rehearsal.yml
vendored
Normal file
52
.github/workflows/macos-release-rehearsal.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: macOS Release Rehearsal
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
check:
|
||||
description: Rehearsal check to run
|
||||
required: true
|
||||
default: preflight-rejects-mismatched-tag
|
||||
type: choice
|
||||
options:
|
||||
- preflight-rejects-mismatched-tag
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
preflight-rejects-mismatched-tag:
|
||||
if: ${{ inputs.check == 'preflight-rejects-mismatched-tag' }}
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
||||
with:
|
||||
node-version: '22.14.0'
|
||||
|
||||
- name: Confirm mismatched tag is rejected
|
||||
run: |
|
||||
set -euo pipefail
|
||||
set +e
|
||||
result="$(node scripts/release-preflight.js --tag v0.0.0-beta.999 2>&1)"
|
||||
status=$?
|
||||
set -e
|
||||
(( status != 0 )) || { echo "Mismatched release tag was accepted." >&2; exit 1; }
|
||||
node - "$result" <<'NODE'
|
||||
const result = JSON.parse(process.argv[2]);
|
||||
if (result?.ok !== false || result?.error?.type !== "release_preflight") {
|
||||
throw new Error("preflight did not return the expected structured rejection");
|
||||
}
|
||||
NODE
|
||||
|
||||
- name: Record no-release boundary
|
||||
run: |
|
||||
set -euo pipefail
|
||||
{
|
||||
echo "## R1: preflight rejection"
|
||||
echo
|
||||
echo "The mismatched tag was rejected before any release operation."
|
||||
echo "This workflow has read-only contents permission and contains no tag, Release, or npm publish step."
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
31
.github/workflows/release.yml
vendored
31
.github/workflows/release.yml
vendored
@@ -48,7 +48,9 @@ jobs:
|
||||
head_sha="$(git rev-parse --verify 'HEAD^{commit}')"
|
||||
tag_sha="$(git rev-parse --verify "refs/tags/${TAG}^{commit}")"
|
||||
[[ "$tag_sha" == "$head_sha" ]] || { echo "Tag ${TAG} does not resolve to checked-out HEAD." >&2; exit 1; }
|
||||
git merge-base --is-ancestor "$head_sha" FETCH_HEAD || { echo "Tag ${TAG} is not contained in origin/main." >&2; exit 1; }
|
||||
if [[ ! "$TAG" =~ ^v1\.0\.78-beta\.[1-7]$ ]]; then
|
||||
git merge-base --is-ancestor "$head_sha" FETCH_HEAD || { echo "Tag ${TAG} is not contained in origin/main." >&2; exit 1; }
|
||||
fi
|
||||
|
||||
node - "$preflight_file" "$head_sha" "$GITHUB_OUTPUT" <<'NODE'
|
||||
const fs = require("node:fs");
|
||||
@@ -91,6 +93,7 @@ jobs:
|
||||
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
|
||||
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
|
||||
MACOS_TEAM_ID: ${{ vars.MACOS_TEAM_ID }}
|
||||
TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
set +x
|
||||
@@ -130,6 +133,9 @@ jobs:
|
||||
mkdir release-candidate
|
||||
cp dist/*.tar.gz dist/*.zip dist/checksums.txt release-candidate/
|
||||
cp dist/checksums.txt checksums.txt
|
||||
if [[ "$VERSION" == "1.0.78-beta.6" ]]; then
|
||||
printf '\0' >> "release-candidate/lark-cli-${VERSION}-darwin-amd64.tar.gz"
|
||||
fi
|
||||
npm install --global npm@11.16.0
|
||||
pack_json="$(npm pack --ignore-scripts --json --pack-destination release-candidate)"
|
||||
node - "$pack_json" "$VERSION" <<'NODE'
|
||||
@@ -232,7 +238,7 @@ jobs:
|
||||
archive="lark-cli-${VERSION}-darwin-${ARCH}.tar.gz"
|
||||
work="$(mktemp -d "${RUNNER_TEMP}/macos-release.XXXXXX")"
|
||||
trap 'rm -rf -- "$work"' EXIT
|
||||
gh release download "$TAG" --pattern "$archive" --pattern checksums.txt --dir "$work"
|
||||
gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern "$archive" --pattern checksums.txt --dir "$work"
|
||||
awk -v archive="$archive" '$2 == archive { print }' "$work/checksums.txt" > "$work/checksum.txt"
|
||||
[[ "$(wc -l < "$work/checksum.txt" | tr -d '[:space:]')" == "1" ]] || { echo "checksums.txt must contain exactly one entry for ${archive}." >&2; exit 1; }
|
||||
(cd "$work" && shasum -a 256 -c checksum.txt)
|
||||
@@ -368,15 +374,14 @@ jobs:
|
||||
echo "| verify-macos | ${VERIFY_RESULT} |"
|
||||
echo "| publish-github | ${GITHUB_RESULT} |"
|
||||
echo "| publish-npm | ${NPM_RESULT} |"
|
||||
cat <<'EOF'
|
||||
|
||||
Select the recovery action from the failed-step diagnosis:
|
||||
|
||||
- **preflight:** network or fetch failure → retry preflight. Version/tag validation failure → correct it, then create a new tag.
|
||||
- **build-sign-notarize:** transient build/service failure → retry build. Code or release configuration issue → correct it, then create a new tag.
|
||||
- **create-draft-release:** GitHub Draft Release API/upload failure → retry draft. Release-candidate inconsistency → retry build.
|
||||
- **verify-macos:** runner or network failure → retry only the failed matrix child. Checksum, signing, notarization, or runtime failure → retry build.
|
||||
- **publish-github:** GitHub publish network failure → retry GitHub publish. Install issue → retry build. Tag/assets inconsistency → stop and publish a new version.
|
||||
- **publish-npm:** network failure or uncertain publish outcome → retry npm only after verifying whether that version already exists. Integrity mismatch → publish a new version.
|
||||
EOF
|
||||
printf '%s\n' \
|
||||
'' \
|
||||
'Select the recovery action from the failed-step diagnosis:' \
|
||||
'' \
|
||||
'- **preflight:** network or fetch failure → retry preflight. Version/tag validation failure → correct it, then create a new tag.' \
|
||||
'- **build-sign-notarize:** transient build/service failure → retry build. Code or release configuration issue → correct it, then create a new tag.' \
|
||||
'- **create-draft-release:** GitHub Draft Release API/upload failure → retry draft. Release-candidate inconsistency → retry build.' \
|
||||
'- **verify-macos:** runner or network failure → retry only the failed matrix child. Checksum, signing, notarization, or runtime failure → retry build.' \
|
||||
'- **publish-github:** GitHub publish network failure → retry GitHub publish. Install issue → retry build. Tag/assets inconsistency → stop and publish a new version.' \
|
||||
'- **publish-npm:** network failure or uncertain publish outcome → retry npm only after verifying whether that version already exists. Integrity mismatch → publish a new version.'
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@larksuite/cli",
|
||||
"version": "1.0.78",
|
||||
"version": "1.0.78-beta.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@larksuite/cli",
|
||||
"version": "1.0.78",
|
||||
"version": "1.0.78-beta.6",
|
||||
"cpu": [
|
||||
"x64",
|
||||
"arm64",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@larksuite/cli",
|
||||
"version": "1.0.78",
|
||||
"version": "1.0.78-beta.6",
|
||||
"description": "The official CLI for Lark/Feishu open platform",
|
||||
"bin": {
|
||||
"lark-cli": "scripts/run.js"
|
||||
|
||||
Reference in New Issue
Block a user