Skip to content

Commit

Permalink
Separate the publish workflows and use new versions (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Sep 9, 2022
1 parent cd78f4b commit 63f7405
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 38 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Publish

on:
release:
types: [published]

jobs:

publish:
uses: stellar/actions/.github/workflows/rust-publish.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
36 changes: 17 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches: [main]
pull_request:
release:
types: [published]

env:
RUSTFLAGS: -D warnings
Expand All @@ -14,7 +12,7 @@ jobs:

complete:
if: always()
needs: [fmt, rust-analyzer-compat, build-and-test, docs]
needs: [fmt, rust-analyzer-compat, build-and-test, docs, publish-dry-run]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
Expand Down Expand Up @@ -53,10 +51,6 @@ jobs:
- run: cargo hack build --target wasm32-unknown-unknown --profile release
- run: cargo hack --feature-powerset --exclude-features docs build --target ${{ matrix.sys.target }}
- run: cargo hack --feature-powerset --exclude-features docs test --target ${{ matrix.sys.target }}
- if: startsWith(github.head_ref, 'release/')
uses: stellar/actions/rust-workspace-publish-dry-run@main
with:
cargo-package-options: --target ${{ matrix.sys.target }}

docs:
runs-on: ubuntu-latest
Expand All @@ -66,15 +60,19 @@ jobs:
- run: rustup install nightly
- run: make doc

publish:
if: github.event_name == 'release'
needs: [complete]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- run: rustup update
- run: cargo install --target-dir ~/.cargo/target --locked --version 0.2.35 cargo-workspaces
- run: make publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish-dry-run:
if: startsWith(github.head_ref, 'release/')
strategy:
matrix:
sys:
- os: ubuntu-latest
target: wasm32-unknown-unknown
cargo-hack-feature-options: ''
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo-hack-feature-options: '--feature-powerset --exclude-features docs'
uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main
with:
runs-on: ${{ matrix.sys.os }}
cargo-hack-feature-options: ${{ matrix.sys.cargo-hack-feature-options }}
cargo-package-options: --target ${{ matrix.sys.target }}
20 changes: 10 additions & 10 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ soroban-sdk = { path = "soroban-sdk" }
soroban-auth = { path = "soroban-auth" }
soroban-spec = { path = "soroban-spec" }
soroban-sdk-macros = { path = "soroban-sdk-macros" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "bd3dc8d2" }
soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "bd3dc8d2" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "bd3dc8d2" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "bd3dc8d2" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "bd3dc8d2" }
soroban-env-common = { git = "https://github.com/stellar/rs-soroban-env", rev = "b08a54a7" }
soroban-env-guest = { git = "https://github.com/stellar/rs-soroban-env", rev = "b08a54a7" }
soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "b08a54a7" }
soroban-env-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "b08a54a7" }
soroban-native-sdk-macros = { git = "https://github.com/stellar/rs-soroban-env", rev = "b08a54a7" }
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "fee9a43" }

# soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" }
Expand Down
2 changes: 1 addition & 1 deletion soroban-sdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ doctest = false

[dependencies]
soroban-spec = "0.0.4"
soroban-env-common = "0.0.4"
soroban-env-common = "0.0.5"
stellar-xdr = { version = "0.0.2", features = ["next", "std"] }
syn = {version="1.0",features=["full"]}
quote = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions soroban-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ bytes-lit = "0.0.3"
ed25519-dalek = { version = "1.0.1", optional = true }

[target.'cfg(target_family="wasm")'.dependencies]
soroban-env-guest = { version = "0.0.4" }
soroban-env-guest = { version = "0.0.5" }

[target.'cfg(not(target_family="wasm"))'.dependencies]
soroban-env-host = { version = "0.0.4", features = ["vm"] }
soroban-env-host = { version = "0.0.5", features = ["vm"] }

[dev-dependencies]
stellar-xdr = { version = "0.0.2", features = ["next", "std"] }
Expand Down
2 changes: 1 addition & 1 deletion soroban-spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rust-version = "1.63"

[dependencies]
stellar-xdr = { version = "0.0.2", features = ["next", "std"] }
soroban-env-host = { version = "0.0.4", features = ["vm", "serde"] }
soroban-env-host = { version = "0.0.5", features = ["vm", "serde"] }
base64 = "0.13.0"
thiserror = "1.0.32"
syn = {version="1.0",features=["full"]}
Expand Down

0 comments on commit 63f7405

Please sign in to comment.