From 09f4eeda8304fea58c32c7d9a651b2607ba6ed05 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda <41065217+TaKO8Ki@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:11:09 +0900 Subject: [PATCH] Use cargo-workspaces for publishing multiple crates (#67) * use cargo-workspaces * add git information --- .github/workflows/release.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33a1ff3..8fec6a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,8 @@ jobs: release: name: Release runs-on: ${{ matrix.os }} + outputs: + gobang_version: ${{ env.GOBANG_VERSION }} env: # For some builds, we use cross to test on 32-bit and big-endian # systems. @@ -53,7 +55,7 @@ jobs: # Apparently, this is the right way to get a tag name. Really? # # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 - echo "GOBANG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "GOBANG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV echo "version is: ${{ env.GOBANG_VERSION }}" - name: Checkout repository @@ -131,13 +133,11 @@ jobs: needs: release steps: - uses: actions/checkout@v1 - - run: cargo login ${CRATES_IO_TOKEN} - env: - CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - - name: Cargo puhlish database-tree + - name: Cargo publish run: | - cd database-tree - cargo publish - - run: sleep 2 - - run: cargo publish - if: ${{ always() }} + git config --global user.email "runner@gha.local" + git config --global user.name "Github Action" + cargo workspaces publish \ + --yes --force '*' --exact \ + --no-git-commit --allow-dirty --skip-published \ + custom ${{ needs.create-release.outputs.gobang_version }}