From 9b7bd4c40c7979b4beccfc2ef5d439658d95eebe Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Fri, 22 Mar 2024 14:49:12 +0100 Subject: [PATCH] ci: add release workflow --- .gitea/workflows/release.yaml | 29 +++++++++++++++++++++++++++++ Cargo.toml | 4 ++++ cli/Cargo.toml | 4 ++-- downloader/Cargo.toml | 2 +- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..bf79372 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,29 @@ +name: Release +on: + push: + tags: + - "*/v*.*.*" + +jobs: + Release: + runs-on: cimaster-latest + steps: + - name: 📦 Checkout repository + uses: actions/checkout@v3 + + - name: Get variables + run: | + echo "CRATE=$(echo '${{ github.ref_name }}' | awk 'BEGIN{RS="/"} NR==1{print}')" >> $GITHUB_ENV + echo "CRATE_VERSION=$(echo '${{ github.ref_name }}' | awk 'BEGIN{RS="/"} NR==2{print}')" >> $GITHUB_ENV + echo "CHANGELOG=$(git show -s --format=%N "${{ github.ref_name }}" | tail -n +4)" >> $GITHUB_ENV + + - name: 📤 Publish crate + run: | + printf '[registries.thetadev]\nindex = "https://code.thetadev.de/ThetaDev/_cargo-index.git"\ntoken = "Bearer ${{ secrets.GITHUB_TOKEN }}"\n' >> ~/.cargo/config.toml + cargo publish --registry thetadev --package "${{ env.CRATE }}" + + - name: 🎉 Publish release + uses: https://gitea.com/actions/release-action@main + with: + title: "${{ env.CRATE }} ${{ env.CRATE_VERSION }}" + body: "${{ env.CHANGELOG }}" diff --git a/Cargo.toml b/Cargo.toml index f7d68a4..2778864 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,10 @@ tokio-test = "0.4.2" 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 } + [features] default = ["default-tls"] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index f6d6053..8df7047 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -39,8 +39,8 @@ rustls-tls-native-roots = [ ] [dependencies] -rustypipe = { path = "../", default-features = false } -rustypipe-downloader = { path = "../downloader", default-features = false } +rustypipe.workspace = true +rustypipe-downloader.workspace = true reqwest.workspace = true tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } futures.workspace = true diff --git a/downloader/Cargo.toml b/downloader/Cargo.toml index 58b9cae..ef8028e 100644 --- a/downloader/Cargo.toml +++ b/downloader/Cargo.toml @@ -29,7 +29,7 @@ rustls-tls-native-roots = [ ] [dependencies] -rustypipe = { path = "../", default-features = false } +rustypipe.workspace = true once_cell.workspace = true regex.workspace = true thiserror.workspace = true