Move back to cargo publish (#814)

This commit is contained in:
Matthias 2022-11-08 17:11:09 +01:00 committed by GitHub
parent 8a17b9e5c8
commit 287624691b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 30 deletions

View file

@ -49,30 +49,43 @@ jobs:
args: --all-targets -- --deny warnings
publish-check:
name: publish check
needs:
- test
- lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- uses: actions-rs/install@v0.1
with:
crate: cargo-publish-all
version: latest
# This currently doesn't work.
# TODO: Re-enable once https://gitlab.com/torkleyy/cargo-publish-all/-/issues/3
# is resolved.
# See also https://github.com/lycheeverse/lychee/pull/346#issuecomment-928355735
#- run: cargo-publish-all --dry-run
- uses: actions/checkout@v1
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: cargo publish lychee-lib
uses: actions-rs/cargo@v1
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
command: publish
args: --dry-run --manifest-path lychee-lib/Cargo.toml
# Can't check lychee binary as it depends on the lib above
# and `--dry-run` doesn't allow unpublished crates yet.
# https://github.com/rust-lang/cargo/issues/1169
# `cargo-publish-all` is a solution but it doesn't work with
# Rust edition 2021.
# Therefore skip the check for now, which is probably fine
# because the binary is just a small wrapper around the CLI
# anyway.
#
# - name: cargo publish lychee
# uses: actions-rs/cargo@v1
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# with:
# command: publish
# args: --dry-run --manifest-path lychee-bin/Cargo.toml
publish:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: startsWith(github.ref, 'refs/tags/')
needs:
- test
- lint
@ -80,18 +93,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- uses: actions-rs/install@v0.1
with:
crate: cargo-publish-all
version: latest
- name: cargo publish lychee-lib
uses: actions-rs/cargo@v1
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- run: cargo-publish-all
with:
command: publish
args: --manifest-path lychee-lib/Cargo.toml
- name: cargo publish lychee
uses: actions-rs/cargo@v1
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
command: publish
args: --manifest-path lychee-bin/Cargo.toml

View file

@ -17,7 +17,7 @@ repository = "https://github.com/lycheeverse/lychee"
version = "0.10.2"
[dependencies]
lychee-lib = { path = "../lychee-lib", version = "0.10.1", default-features = false }
lychee-lib = { path = "../lychee-lib", version = "0.10.2", default-features = false }
anyhow = "1.0.66"
console = "0.15.2"
const_format = "0.2.30"