Skip to content

Commit

Permalink
use env file in github action
Browse files Browse the repository at this point in the history
Signed-off-by: hexilee <i@hexilee.me>
  • Loading branch information
Hexilee committed Mar 29, 2021
1 parent 892ce23 commit 06a6843
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
sudo apt-get install -y libsqlite3-dev
- name: get version
working-directory: ${{ matrix.package.path }}
run: echo ::set-env name=PACKAGE_VERSION::$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml)
run: echo "PACKAGE_VERSION=$(sed -nE 's/^\s*version = \"(.*?)\"/\1/p' Cargo.toml)" >> $GITHUB_ENV
- name: check published version
run: echo ::set-env name=PUBLISHED_VERSION::$(cargo search ${{ matrix.package.registryName }} --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -)
run: echo "PUBLISHED_VERSION=$(cargo search ${{ matrix.package.registryName }} --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -)" >> $GITHUB_ENV
- name: cargo login
if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION
run: cargo login ${{ secrets.CRATE_TOKEN }}
Expand Down

0 comments on commit 06a6843

Please sign in to comment.