Skip to content

Commit

Permalink
refactor: lift sdk to top level (#414)
Browse files Browse the repository at this point in the history
Lifts SDK to top level of repo and updates release please to v4.
  • Loading branch information
malandis authored Dec 16, 2024
1 parent 771d4b8 commit 437898f
Show file tree
Hide file tree
Showing 141 changed files with 44 additions and 49 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,22 @@ jobs:
template_file: ./example/aws/zip-lambda/README.template.md
output_file: ./example/aws/zip-lambda/README.md


release-please:
name: Release Please
runs-on: ubuntu-latest
needs: [ generate_readme ]
needs: [generate_readme]
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v3
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
release-type: rust
package-name: momento
default-branch: main
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
extra-files: |
sdk/Cargo.toml
sdk/test-util/Cargo.toml

publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: [ release-please ]
needs: [release-please]
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
if: ${{ needs.release-please.outputs.release_created == 'true' }}
Expand All @@ -116,4 +108,3 @@ jobs:
- name: Publish
run: |
make publish
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.46.0"
}
2 changes: 1 addition & 1 deletion sdk/Cargo.lock → Cargo.lock

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

2 changes: 1 addition & 1 deletion sdk/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "momento"
version = "0.46.0" # x-release-please-version
version = "0.46.0"
authors = ["momento"]
edition = "2018"
description = "Client SDK for Momento services"
Expand Down
23 changes: 10 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ all: precommit
.PHONY: format
## Format all files
format:
cd sdk && cargo fmt
cargo fmt

.PHONY: lint
## Check the formatting of all files, run clippy on the source code, then run
## clippy on the tests (but allow expect to be used in tests)
lint:
cd sdk && \
cargo fmt -- --check && \
cargo clippy --all-features -- -D warnings -W clippy::unwrap_used -W clippy::expect_used -W missing_docs && \
cargo clippy --tests -- -D warnings -W clippy::unwrap_used

.PHONY: build
## Build project
build:
cd sdk && cargo build --verbose
cargo build --verbose

.PHONY: clean
## Remove build files
clean:
cd sdk && cargo clean
cargo clean

.PHONY: clean-build
## Build project
Expand All @@ -33,7 +32,7 @@ clean-build: clean build
.PHONY: docs
## Build the docs, fail on warnings
docs:
cd sdk && RUSTDOCFLAGS="-D warnings" cargo doc
RUSTDOCFLAGS="-D warnings" cargo doc

.PHONY: precommit
## Run clean-build and test as a step before committing.
Expand All @@ -42,26 +41,26 @@ precommit: clean-build lint test build-examples

.PHONY: test-unit
test-unit:
cd sdk && cargo test --lib
cargo test --lib

.PHONY: test-doctests
test-doctests:
cd sdk && cargo test --doc
cargo test --doc

.PHONY: ci-test-setup
ci-test-setup:
# This script relies on dev dependencies such as Tokio, so we run it with the --example flag
cd sdk && cargo run --example test-setup
cargo run --example test-setup

.PHONY: test-integration
## Run integration tests
test-integration:
cd sdk && cargo test --tests
cargo test --tests

.PHONY: ci-test-teardown
ci-test-teardown:
# This script relies on dev dependencies such as Tokio, so we run it with the --example flag
cd sdk && cargo run --example test-teardown
cargo run --example test-teardown

.PHONY: test
## Run unit and integration tests
Expand Down Expand Up @@ -91,8 +90,6 @@ help:

.PHONY: publish
publish:
cd sdk && \
cp ../README.md . && \
cargo publish --allow-dirty
cargo publish


File renamed without changes.
25 changes: 25 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "rust",
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous",
"hidden": false
}
]
}
}
}
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions sdk/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions sdk/CHANGELOG.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sdk/test-util/Cargo.toml → test-util/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "momento-test-util"
version = "0.46.0" # x-release-please-version
version = "0.1.0"
edition = "2021"
publish = false

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 437898f

Please sign in to comment.