-
Notifications
You must be signed in to change notification settings - Fork 0
BOG-223 Rust Upbit SDK implementation #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 a8a00aa
Merge pull request #1 from Bogyie/issue/BOG-235-sdk-foundation-spec
Bogyie d933ee9
BOG-236 Add spec-driven Upbit mock server
Bogyie d5fa02a
Add SDK core auth config and errors
Bogyie bd8ee9f
Restrict HTTP base URLs to loopback
Bogyie 9791454
BOG-236 Enforce mock path parameter enums
Bogyie b4b76cd
Merge pull request #3 from Bogyie/issue/BOG-237-sdk-core-auth-errors-…
Bogyie 0ddacbb
Merge integration/BOG-223-upbit-rust-sdk into BOG-236
Bogyie 34fd942
Merge pull request #2 from Bogyie/issue/BOG-236-mock-server-spec-conf…
Bogyie b1e9ac2
Add retry fallback and redacted logging controls
Bogyie c7f5f4d
Merge integration/BOG-223-upbit-rust-sdk into BOG-239
Bogyie 9e33164
Merge pull request #4 from Bogyie/issue/BOG-239-retry-fallback-loggin…
Bogyie d1e47f3
BOG-238 Add typed REST endpoint coverage
Bogyie cf46257
BOG-238 Clarify mock credential usage
Bogyie 569e567
Merge remote-tracking branch 'origin/integration/BOG-223-upbit-rust-s…
Bogyie 034e76c
Merge pull request #5 from Bogyie/issue/BOG-238-sdk-endpoint-coverage
Bogyie 3c1f94e
BOG-242 Prepare SDK docs and package metadata
Bogyie 798f388
Merge pull request #6 from Bogyie/issue/BOG-242-docs-usage-crates-rea…
Bogyie 77de52a
BOG-244 Add crates publish workflow
Bogyie 13dfe17
BOG-244 Harden crates publish workflow
Bogyie 97253b3
Merge pull request #7 from Bogyie/issue/BOG-244-crates-publish-workflow
Bogyie a0b10e0
BOG-246 Trigger publish on GitHub release
Bogyie 91d7ca6
Merge pull request #8 from Bogyie/issue/BOG-246-release-publish-trigger
Bogyie c0f34ab
BOG-240 Add final reconciliation evidence
Bogyie da510ca
Merge pull request #9 from Bogyie/issue/BOG-240-final-spec-qa-securit…
Bogyie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /target/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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_commitis reachable fromtag_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.