Skip to content

Commit

Permalink
Merge #281
Browse files Browse the repository at this point in the history
281: ci: correct crate publish action r=Taowyoo a=Taowyoo

Correct action config, add `environment` field, ref: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#using-an-environment

Co-authored-by: Yuxiang Cao <[email protected]>
Co-authored-by: YxC <[email protected]>
  • Loading branch information
bors[bot] and Taowyoo authored Jun 12, 2023
2 parents 4cb8132 + 1e627b8 commit c5c6977
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@ permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
crate_publish:
environment: "publish to crates.io"
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y clang-11 cmake
- name: Symlink libclang.so
run: sudo ln -s /lib/x86_64-linux-gnu/libclang-11.so.1 /lib/x86_64-linux-gnu/libclang.so
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: |
crate_name=$(python3 -c "print('$GITHUB_REF'.split('/')[2].rsplit('_v', 1)[0])") && \
cargo publish --token ${CARGO_REGISTRY_TOKEN} --package "$crate_name" --dry-run
export crate_name=$(python3 -c "print('$GITHUB_REF'.split('/')[2].rsplit('_v', 1)[0])")
echo "Publishing crate: $crate_name"
cargo publish --locked --token ${CARGO_REGISTRY_TOKEN} --package "$crate_name"
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
RUSTFLAGS: "-A ambiguous_glob_reexports"
RUST_BACKTRACE: "1"
6 changes: 3 additions & 3 deletions 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 mbedtls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tokio = { version = "1.16.1", optional = true }
rs-libc = "0.2.0"

[dependencies.mbedtls-sys-auto]
version = "2.25.0"
version = "2.26.0"
default-features = false
features = ["trusted_cert_callback", "threading"]
path = "../mbedtls-sys"
Expand Down

0 comments on commit c5c6977

Please sign in to comment.