From 0bcced1db377198a54c9c7d03b8d038125a2bfe4 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Fri, 22 Mar 2024 23:56:05 +0100 Subject: [PATCH 1/3] chore: changes to release command --- Justfile | 20 +++++++++----------- README.md | 2 -- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Justfile b/Justfile index c8d2dd1..7821cce 100644 --- a/Justfile +++ b/Justfile @@ -51,7 +51,6 @@ release crate="rustypipe": CRATE="{{crate}}" INCLUDES='--include-path README.md --include-path LICENSE --include-path Cargo.toml' CHANGELOG="CHANGELOG.md" - CARGO_TOML="Cargo.toml" if [ "$CRATE" = "rustypipe" ]; then INCLUDES="$INCLUDES --include-path src/** --include-path tests/** --include-path testfiles/**" @@ -61,19 +60,16 @@ release crate="rustypipe": fi INCLUDES="$INCLUDES --include-path $CRATE/**" CHANGELOG="$CRATE/$CHANGELOG" - CARGO_TOML="$CRATE/Cargo.toml" CRATE="rustypipe-$CRATE" # Add crate name prefix fi - VERSION=$(git-cliff $INCLUDES --bumped-version | grep -Po '\d+\.\d+\.\d+$') - echo "Releasing $VERSION:" + VERSION=$(cargo pkgid --package "$CRATE" | tr '#@' '\n' | tail -n 1) + TAG="${CRATE}/v${VERSION}" + echo "Releasing $TAG:" - if [ -n "$(git status --porcelain)" ]; then echo "Workdir must be clean"; exit 1; fi - if git rev-parse "${CRATE}/v${VERSION}" >/dev/null 2>&1; then echo "version tag v${VERSION} already exists"; exit 1; fi + if git rev-parse "$TAG" >/dev/null 2>&1; then echo "version tag $TAG already exists"; exit 1; fi - cargo semver -c "$CARGO_TOML" set "$VERSION" - - CLIFF_ARGS="--tag v${VERSION} --unreleased $INCLUDES" + CLIFF_ARGS="--tag v${VERSION} --tag-pattern ${CRATE}/* --unreleased $INCLUDES" echo "git-cliff $CLIFF_ARGS" if [ -f "$CHANGELOG" ]; then git-cliff $CLIFF_ARGS --prepend "$CHANGELOG" @@ -83,7 +79,9 @@ release crate="rustypipe": editor "$CHANGELOG" - git add "$CHANGELOG" "$CARGO_TOML" + git add "$CHANGELOG" git commit -m "chore(release): release $CRATE v$VERSION" - awk 'BEGIN{RS="(^|\n)## [^\n]+\n*"} NR==2 { print }' "$CHANGELOG" | git tag -as -F - --cleanup whitespace "${CRATE}/v${VERSION}" + awk 'BEGIN{RS="(^|\n)## [^\n]+\n*"} NR==2 { print }' "$CHANGELOG" | git tag -as -F - --cleanup whitespace "$TAG" + + echo "🚀 Run 'git push origin $TAG' to publish" diff --git a/README.md b/README.md index 83bd294..a24ccfb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # RustyPipe -[![CI status](https://ci.thetadev.de/api/badges/ThetaDev/rustypipe/status.svg)](https://ci.thetadev.de/ThetaDev/rustypipe) - Client for the public YouTube / YouTube Music API (Innertube), inspired by [NewPipe](https://github.com/TeamNewPipe/NewPipeExtractor). From 6598a23d0699e6fe298275a67e0146a19c422c88 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 23 Mar 2024 00:24:41 +0100 Subject: [PATCH 2/3] fix: specify internal dependency versions --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2778864..165b667 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,8 +63,8 @@ insta = { version = "1.17.1", features = ["ron", "redactions"] } path_macro = "1.0.0" # Included crates -rustypipe = { path = ".", default-features = false } -rustypipe-downloader = { path = "./downloader", default-features = false } +rustypipe = { path = ".", version = "0.1.0", default-features = false } +rustypipe-downloader = { path = "./downloader", version = "0.1.0", default-features = false } [features] default = ["default-tls"] From 9afa5ff0cc976b98603482ebf6c3aa2e277087c4 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 23 Mar 2024 00:40:54 +0100 Subject: [PATCH 3/3] ci: set registry on internal deps correctly --- .gitea/workflows/release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 6c4dc19..92c0fea 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -23,11 +23,13 @@ jobs: echo END_OF_FILE } >> "$GITHUB_ENV" - - name: 📤 Publish crate + - name: 📤 Publish crate on code.thetadev.de run: | mkdir -p ~/.cargo printf '[registries.thetadev]\nindex = "https://code.thetadev.de/ThetaDev/_cargo-index.git"\ntoken = "Bearer ${{ secrets.TOKEN_GITEA }}"\n' >> ~/.cargo/config.toml + sed -i "s/^rustypipe.*=\s*{/\0 registry = \"thetadev\",/g" Cargo.toml cargo publish --registry thetadev --package "${{ env.CRATE }}" + git restore Cargo.toml - name: 🎉 Publish release uses: https://gitea.com/actions/release-action@main