From af6b8ed095f88f1df2116cdc7a9d44872cfa6074 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 18 Apr 2024 07:39:07 +0200 Subject: Adding upstream version 0.26.0. Signed-off-by: Daniel Baumann --- .github/workflows/cbindgen.yml | 87 ++++++++++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 56 +++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 .github/workflows/cbindgen.yml create mode 100644 .github/workflows/deploy.yml (limited to '.github') diff --git a/.github/workflows/cbindgen.yml b/.github/workflows/cbindgen.yml new file mode 100644 index 0000000..13b1d04 --- /dev/null +++ b/.github/workflows/cbindgen.yml @@ -0,0 +1,87 @@ +name: cbindgen + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + rustfmt-clippy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: "clippy, rustfmt" + + - name: Run rustfmt + run: | + cargo +stable fmt --check + + - name: Run clippy + run: | + cargo +stable clippy --workspace -- -D warnings + + - name: Install minimum supported Rust version + id: msrv + uses: dtolnay/rust-toolchain@1.64 + + - name: Build with minimum supported Rust version + run: | + cargo +${{steps.msrv.outputs.name}} test nonexistent-test --verbose + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install stable Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + + - name: Install Cython + run: | + python -m pip install --upgrade pip wheel + pip install Cython==3.0.2 + + - name: Build + run: | + cargo +stable build --verbose + + - name: Build no-default-features + run: | + cargo +stable build --verbose --no-default-features + + - name: Test package + env: + CBINDGEN_TEST_VERIFY: 1 + run: | + cargo +stable package --verbose + (cd target/package/cbindgen-$(cargo +stable run -- --version | cut -d ' ' -f 2) && cargo +stable test --verbose) + + - name: Install nightly Rust + uses: dtolnay/rust-toolchain@nightly + + - name: Test + env: + CBINDGEN_TEST_VERIFY: 1 + run: | + cargo +nightly test --verbose + + - name: Test minimal-versions + run: | + cargo +nightly update -Zminimal-versions + cargo +nightly test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b77b173 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: deploy + +on: + push: + tags: + - 'v*.*.*' + +jobs: + + linux-binaries: + permissions: + # Grant the GITHUB_TOKEN additional permissions necessary for creating a release. + # We only run this action for tags, so any code has already been reviewed by + # someone with permissions to create a tag. + contents: write + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + + - name: Install stable + uses: dtolnay/rust-toolchain@stable + + - name: semver + run: | + cargo +stable install cargo-semver-checks --locked + cargo +stable semver-checks check-release + + - name: Build cbindgen + run: | + cargo +stable build --release + + - name: Strip cbindgen + run: | + strip target/release/cbindgen + + - name: Handle release data and files + id: tagName + run: | + VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2) + echo "::set-output name=version::$VERSION" + # Steps to extract the last release notes from CHANGES: + # 1. Remove the first three lines + # 2. Stop at the next heading level + # 3. Remove the last line + # 4. Deindent the bullet points to avoid a markdown code block + tail -n +3 CHANGES | sed '/^##/q' | + sed '$ d' | awk '{$1=$1};1' > CHANGES.txt + + - name: Create a release + run: | + TAG=${{ steps.tagName.outputs.version }} + gh release create ${TAG} --title "${TAG}" --notes-file "CHANGES.txt" --draft 'target/release/cbindgen#cbindgen-ubuntu20.04' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3