Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
514f9ad
Add Rust workspace and Upbit API spec
Bogyie May 29, 2026
a8a00aa
Merge pull request #1 from Bogyie/issue/BOG-235-sdk-foundation-spec
Bogyie May 29, 2026
d933ee9
BOG-236 Add spec-driven Upbit mock server
Bogyie May 29, 2026
d5fa02a
Add SDK core auth config and errors
Bogyie May 29, 2026
bd8ee9f
Restrict HTTP base URLs to loopback
Bogyie May 29, 2026
9791454
BOG-236 Enforce mock path parameter enums
Bogyie May 29, 2026
b4b76cd
Merge pull request #3 from Bogyie/issue/BOG-237-sdk-core-auth-errors-…
Bogyie May 29, 2026
0ddacbb
Merge integration/BOG-223-upbit-rust-sdk into BOG-236
Bogyie May 29, 2026
34fd942
Merge pull request #2 from Bogyie/issue/BOG-236-mock-server-spec-conf…
Bogyie May 29, 2026
b1e9ac2
Add retry fallback and redacted logging controls
Bogyie May 29, 2026
c7f5f4d
Merge integration/BOG-223-upbit-rust-sdk into BOG-239
Bogyie May 29, 2026
9e33164
Merge pull request #4 from Bogyie/issue/BOG-239-retry-fallback-loggin…
Bogyie May 29, 2026
d1e47f3
BOG-238 Add typed REST endpoint coverage
Bogyie May 29, 2026
cf46257
BOG-238 Clarify mock credential usage
Bogyie May 29, 2026
569e567
Merge remote-tracking branch 'origin/integration/BOG-223-upbit-rust-s…
Bogyie May 29, 2026
034e76c
Merge pull request #5 from Bogyie/issue/BOG-238-sdk-endpoint-coverage
Bogyie May 29, 2026
3c1f94e
BOG-242 Prepare SDK docs and package metadata
Bogyie May 29, 2026
798f388
Merge pull request #6 from Bogyie/issue/BOG-242-docs-usage-crates-rea…
Bogyie May 29, 2026
77de52a
BOG-244 Add crates publish workflow
Bogyie May 29, 2026
13dfe17
BOG-244 Harden crates publish workflow
Bogyie May 29, 2026
97253b3
Merge pull request #7 from Bogyie/issue/BOG-244-crates-publish-workflow
Bogyie May 29, 2026
a0b10e0
BOG-246 Trigger publish on GitHub release
Bogyie May 29, 2026
91d7ca6
Merge pull request #8 from Bogyie/issue/BOG-246-release-publish-trigger
Bogyie May 29, 2026
c0f34ab
BOG-240 Add final reconciliation evidence
Bogyie May 29, 2026
da510ca
Merge pull request #9 from Bogyie/issue/BOG-240-final-spec-qa-securit…
Bogyie May 29, 2026
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
143 changes: 143 additions & 0 deletions .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Publish crates.io package

on:
release:
types:
- published
pull_request:
paths:
- ".github/workflows/publish-crates.yml"
- "Cargo.toml"
- "Cargo.lock"
- "crates/upbit-sdk/**"
push:
branches:
- integration/BOG-223-upbit-rust-sdk
- main
paths:
- ".github/workflows/publish-crates.yml"
- "Cargo.toml"
- "Cargo.lock"
- "crates/upbit-sdk/**"
workflow_dispatch:
inputs:
mode:
description: "Run a dry run or publish the upbit-sdk crate."
required: true
type: choice
default: dry-run
options:
- dry-run
- publish

permissions:
contents: read

concurrency:
group: publish-crates-${{ github.ref }}
cancel-in-progress: false

env:
CARGO_TERM_COLOR: always
CRATE_PATH: crates/upbit-sdk

jobs:
dry-run:
name: Dry-run upbit-sdk publish
if: ${{ github.event_name != 'release' && (github.event_name != 'workflow_dispatch' || inputs.mode == 'dry-run') }}
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Select stable Rust toolchain
run: |
rustup update stable
rustup default stable

- name: Confirm dry-run behavior
run: echo "Dry-run mode selected; no crates.io upload will be attempted."

- name: Check package metadata
run: cargo package -p upbit-sdk --allow-dirty --list

- name: Dry-run publish crate
uses: katyo/publish-crates@02cc2f1ad653fb25c7d1ff9eb590a8a50d06186b
with:
path: ${{ env.CRATE_PATH }}
dry-run: true
check-repo: false

publish:
name: Publish upbit-sdk
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.mode == 'publish') }}
runs-on: ubuntu-latest
environment: crates-io
env:
HAS_CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN != '' }}

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Select stable Rust toolchain
run: |
rustup update stable
rustup default stable

- name: Validate publish preconditions
run: |
set -euo pipefail
if [[ "${GITHUB_REF_TYPE}" != "tag" ]]; then
echo "Real publish must run from a release tag ref." >&2
exit 1
fi
if [[ "${HAS_CARGO_REGISTRY_TOKEN}" != "true" ]]; then
echo "CARGO_REGISTRY_TOKEN secret is required for real publish." >&2
exit 1
fi

git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main
tag_commit="$(git rev-parse "${GITHUB_REF_NAME}^{commit}")"
main_commit="$(git rev-parse "origin/main^{commit}")"

if ! git merge-base --is-ancestor "${tag_commit}" "${main_commit}"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: The ancestry check validates that main_commit is reachable from tag_commit, but it should verify the opposite. This will incorrectly reject valid release tags that point to commits already merged into main and incorrectly accept tags that point to commits not yet in main.

Suggested change
if ! git merge-base --is-ancestor "${tag_commit}" "${main_commit}"; then
if ! git merge-base --is-ancestor "${main_commit}" "${tag_commit}"; then

echo "Release tag ${GITHUB_REF_NAME} must point to a commit already reachable from origin/main." >&2
exit 1
fi

if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
event_action="$(jq -r '.action // ""' "${GITHUB_EVENT_PATH}")"
if [[ "${event_action}" != "published" ]]; then
echo "Release-triggered publishing only accepts the published action." >&2
exit 1
fi

release_target="$(jq -r '.release.target_commitish // ""' "${GITHUB_EVENT_PATH}")"
case "${release_target}" in
main|refs/heads/main|"${main_commit}"|"${tag_commit}")
;;
*)
echo "Release target_commitish must be main or the verified main/tag commit; got '${release_target}'." >&2
exit 1
;;
esac

echo "Release publish preconditions satisfied for ${GITHUB_REF_NAME} on main."
else
echo "Manual publish preconditions satisfied for ${GITHUB_REF_NAME} on main."
fi

- name: Check package metadata
run: cargo package -p upbit-sdk --allow-dirty --list

- name: Publish crate
uses: katyo/publish-crates@02cc2f1ad653fb25c7d1ff9eb590a8a50d06186b
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
path: ${{ env.CRATE_PATH }}
dry-run: false
check-repo: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
Loading
Loading