From 260452f72485ed3374e9ba56ad654e9d535f9dcf Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 16 May 2023 16:24:57 +0100 Subject: [PATCH 1/2] ci: [#152] add workflow to publish on crates.io --- .github/workflows/publish_crate.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/publish_crate.yml diff --git a/.github/workflows/publish_crate.yml b/.github/workflows/publish_crate.yml new file mode 100644 index 00000000..4d5d0772 --- /dev/null +++ b/.github/workflows/publish_crate.yml @@ -0,0 +1,57 @@ +name: Publish crate + +on: + push: + tags: + - "v*" + +jobs: + check-secret: + runs-on: ubuntu-latest + environment: crates-io-torrust + outputs: + publish: ${{ steps.check.outputs.publish }} + steps: + - id: check + env: + CRATES_TOKEN: "${{ secrets.CRATES_TOKEN }}" + if: "${{ env.CRATES_TOKEN != '' }}" + run: echo "publish=true" >> $GITHUB_OUTPUT + + test: + needs: check-secret + if: needs.check-secret.outputs.publish == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: llvm-tools-preview + - uses: Swatinem/rust-cache@v2 + - name: Run Tests + run: cargo test + + publish: + needs: test + if: needs.check-secret.outputs.publish == 'true' + runs-on: ubuntu-latest + environment: crates-io-torrust + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Publish workspace packages + run: | + cargo publish -p torrust-tracker-located-error + cargo publish -p torrust-tracker-primitives + cargo publish -p torrust-tracker-configuration + cargo publish -p torrust-tracker-test-helpers + cargo publish -p torrust-tracker + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }} From 75ec0a61903796097f9dcc59950ad2400ba7a840 Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 16 May 2023 16:35:24 +0100 Subject: [PATCH 2/2] feat: release 2.0.0-alpha.1 --- Cargo.lock | 2 +- Cargo.toml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4daab711..c04ca2b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3023,7 +3023,7 @@ dependencies = [ [[package]] name = "torrust-index-backend" -version = "2.0.0-dev.1" +version = "2.0.0-alpha.1" dependencies = [ "actix-cors", "actix-multipart", diff --git a/Cargo.toml b/Cargo.toml index 0d92bcdb..ade5ac7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "torrust-index-backend" -version = "2.0.0-dev.1" +description = "The backend (API) for the Torrust Index project." +license-file = "COPYRIGHT" +version = "2.0.0-alpha.1" authors = ["Mick van Dijke ", "Wesley Bijleveld "] +repository = "https://github.com/torrust/torrust-index-backend" edition = "2021" default-run = "main"