From 8839ccd429035e282b548e18978be2497af2a43d Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 21 Aug 2024 18:39:51 +0200 Subject: [PATCH] feat: added publishing steps --- .github/workflows/publish.yml | 27 +++++++++++++++++++++++++++ build/rust/Cargo.lock | 2 +- build/rust/Cargo.toml | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ae64016..e57a961 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,3 +39,30 @@ jobs: run: bundle exec rake release:rubygem_push - name: Wait for release run: gem exec rubygems-await pkg/*.gem + crates: + runs-on: ubuntu-latest + + environment: packages + + defaults: + run: + shell: bash + working-directory: build/rust + + steps: + # Set up + - uses: actions/checkout@v4 + - name: Setup rust + run: rustup update --no-self-update stable + - name: Install protoc + run: curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v28.0-rc1/protoc-28.0-rc-1-linux-x86_64.zip && unzip protoc-28.0-rc-1-linux-x86_64.zip -d ${{ runner.temp }}/proto && chmod +x ${{ runner.temp }}/proto/bin/protoc && ${{ runner.temp }}/proto/bin/protoc --version + - name: Set version + run: sed -i "s/version = \"0.0.0\"/version = \"${{ github.ref_name }}\"/" Cargo.toml + - name: Cargo Login + run: cargo login ${{secrets.CARGO_REGISTRY_TOKEN}} + + # Release + - name: Publish crate + run: PATH=${{ runner.temp }}/proto/bin:$PATH cargo publish --allow-dirty + env: + RUST_BACKTRACE: 'full' \ No newline at end of file diff --git a/build/rust/Cargo.lock b/build/rust/Cargo.lock index ee7efc6..baa9c6a 100644 --- a/build/rust/Cargo.lock +++ b/build/rust/Cargo.lock @@ -1055,7 +1055,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tucana-internal" -version = "0.0.1" +version = "0.0.0" dependencies = [ "prost", "prost-serde-derive", diff --git a/build/rust/Cargo.toml b/build/rust/Cargo.toml index b9080be..39cf4fc 100644 --- a/build/rust/Cargo.toml +++ b/build/rust/Cargo.toml @@ -1,5 +1,5 @@ [package] -version = "0.0.1" +version = "0.0.0" name = "tucana-internal" edition = "2021" description = "The rust crate for the internal gRPC communication of Code0"