Skip to content

Commit

Permalink
Merge #153: Package release: 2.0.0-alpha.1
Browse files Browse the repository at this point in the history
75ec0a6 feat: release 2.0.0-alpha.1 (Jose Celano)
260452f ci: [#152] add workflow to publish on crates.io (Jose Celano)

Pull request description:

  Prepare new release: `2.0.0-alpha.1`

  - [x] Add workflow to publish package on crates.io
  - [x] Update `Cargo.toml` with mandatory attributes and change version

ACKs for top commit:
  josecelano:
    ACK 75ec0a6

Tree-SHA512: 1202387282bc1274ade148dbf212404dff0345ae7af894c02bda0ba8392e8d7fc61e26dd8c6d46307d871a8b5eaa658e14e98bcbfb0141c951292b3880dca1d0
  • Loading branch information
josecelano committed May 16, 2023
2 parents 9c84608 + 75ec0a6 commit ef23d74
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>", "Wesley Bijleveld <[email protected]>"]
repository = "https://github.com/torrust/torrust-index-backend"
edition = "2021"
default-run = "main"

Expand Down

0 comments on commit ef23d74

Please sign in to comment.