This commit is contained in:
1 parent
84c5eb571c
commit
8af4d2cbbc
7 files changed
+143
-33
No files matched your search
@@ -2,6 +2,8 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
|
||||
@@ -18,20 +18,12 @@ env:
|
||||
CARGO_NET_RETRY: 10
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
build:
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check registry credentials
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
|
||||
echo "::error::Add the CARGO_REGISTRY_TOKEN repository Actions secret, then rerun this workflow."
|
||||
exit 1
|
||||
fi
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.97"
|
||||
@@ -42,7 +34,39 @@ jobs:
|
||||
- run: cargo check --workspace --all-targets --all-features --locked
|
||||
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
|
||||
- run: cargo test --workspace --locked
|
||||
- name: Publish unpublished workspace versions
|
||||
- name: Verify release packages once
|
||||
run: python3 scripts/publish_crates.py --dry-run
|
||||
|
||||
publish-crates-io:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.97"
|
||||
- name: Publish to crates.io without rebuilding
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
run: python3 scripts/publish_crates.py
|
||||
run: python3 scripts/publish_crates.py --no-verify
|
||||
|
||||
publish-gitea:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: "1.97"
|
||||
- name: Publish mirror to Gitea without rebuilding
|
||||
env:
|
||||
GITEA_PACKAGES_TOKEN: ${{ secrets.GITEA_PACKAGES_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$GITEA_PACKAGES_TOKEN" ]; then
|
||||
echo "::error::Add the GITEA_PACKAGES_TOKEN repository Actions secret, then rerun this workflow."
|
||||
exit 1
|
||||
fi
|
||||
export CARGO_REGISTRIES_GITEA_TOKEN="Bearer $GITEA_PACKAGES_TOKEN"
|
||||
python3 scripts/publish_crates.py --registry gitea --no-verify
|
||||
Reference in new issue
Block a user