Skip to content
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

Official crates.io release #155

Merged
merged 13 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 51 additions & 14 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ jobs:
name: Check nightly stable and MSRV
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
# - windows-latest
rust:
- 1.60.0
- 1.66.1
- stable
# - nightly
steps:
Expand All @@ -43,27 +42,47 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: check
args: --features proc_macros,log,out-refs
args: --features log

releasable-to-crates-io:
name: Check the package can be released to crates.io
runs-on: ubuntu-latest
needs: check
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.66.1
override: true

- name: Clone repo
uses: actions/checkout@v2

- uses: actions-rs/cargo@v1
with:
command: package
args: --allow-dirty --no-verify

check-features:
name: Check all the features combinations on MSRV
runs-on: ubuntu-latest
needs: check
strategy:
fail-fast: false
matrix:
feature--std: ['', '--features alloc', '--features std']
feature--async-fn: ['', '--features async-fn']
feature--headers: ['', '--features headers', '--features csharp-headers']
feature--headers: ['', '--features headers']
feature--dyn-traits: ['', '--features dyn-traits', '--features futures', '--features tokio']
# feature--log: ['', '--features log']
feature--out-refs: ['', '--features out-refs']
feature--js: ['', '--features js']
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.60.0
toolchain: 1.66.1
override: true

- name: Clone repo
Expand All @@ -78,14 +97,13 @@ jobs:
${{ matrix.feature--async-fn }}
${{ matrix.feature--headers }}
${{ matrix.feature--dyn-traits }}
${{ matrix.feature--out-refs }}
${{ matrix.feature--js }}

# == BUILD & TEST == #
build-and-test:
name: Build and test
runs-on: ${{ matrix.os }}
needs: [check, check-features]
needs: [check]
strategy:
fail-fast: false
matrix:
Expand All @@ -94,9 +112,9 @@ jobs:
- macos-latest
- windows-latest
rust:
# - 1.60.0
- 1.66.1
- stable
- nightly
# - nightly
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -135,10 +153,29 @@ jobs:
RUSTFLAGS: -Zmacro-backtrace
RUST_BACKTRACE: full

all-good:
name: All the required checks
needs:
- check
- check-features
- build-and-test
- releasable-to-crates-io
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Job Checks
run: |
RESULT=$(echo "${{ join(needs.*.result, '') }}" | sed -e "s/success//g")
if [ -n "$RESULT" ]; then
echo "One or more jobs failed"
exit 1
fi
echo "All jobs succeeded"

# Deploy to Github pages #
deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs:
- build-and-test
steps:
Expand All @@ -147,12 +184,12 @@ jobs:
with:
profile: default
override: true
toolchain: 1.60.0
toolchain: 1.66.1

- name: Install `mdbook`
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.3.7'
mdbook-version: '0.4.4'

- name: Clone repo
uses: actions/checkout@v2
Expand All @@ -168,7 +205,7 @@ jobs:
- name: Build guide and documentation
run: |
(cd guide
(cd src && sed -e "s@{ROOT_PATH}@${URL_ROOT_PATH}@" links.md.template > links.md)
(cd src && sed -e "s,{ROOT_PATH},${URL_ROOT_PATH}," links.md.template > links.md)
mdbook build
mkdir -p book/{assets,rustdoc}
cp -r assets/* book/assets/
Expand Down
Loading