Skip to content

Commit

Permalink
Update rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sjbwylbs authored Oct 27, 2023
1 parent 6f106ba commit 9769002
Showing 1 changed file with 46 additions and 47 deletions.
93 changes: 46 additions & 47 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,50 @@ env:
jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
- name: poem-derive
registryName: poem-derive
path: poem-derive
- name: poem
registryName: poem
path: poem
- name: poem-lambda
registryName: poem-lambda
path: poem-lambda
- name: poem-openapi-derive
registryName: poem-openapi-derive
path: poem-openapi-derive
- name: poem-openapi
registryName: poem-openapi
path: poem-openapi
- name: poem-grpc-build
registryName: poem-grpc-build
path: poem-grpc-build
- name: poem-grpc
registryName: poem-grpc
path: poem-grpc
steps:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout
uses: actions/checkout@v3
- name: Install Protoc
if: matrix.package.name == 'poem-grpc'
uses: arduino/setup-protoc@v1
- name: Get Version
working-directory: ${{ matrix.package.path }}
run: echo PACKAGE_VERSION=$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml) >> $GITHUB_ENV
- name: Check Published Version
run: echo PUBLISHED_VERSION=$(cargo search ${{ matrix.package.registryName }} --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -) >> $GITHUB_ENV
- name: Cargo Package
if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION
working-directory: ${{ matrix.package.path }}
run: |
cargo package
echo "We will publish:" $PACKAGE_VERSION
echo "This is current latest:" $PUBLISHED_VERSION
fail-fast: false
max-parallel: 1
matrix:
package:
- name: poem-derive
registryName: poem-derive
path: poem-derive
- name: poem
registryName: poem
path: poem
- name: poem-lambda
registryName: poem-lambda
path: poem-lambda
- name: poem-openapi-derive
registryName: poem-openapi-derive
path: poem-openapi-derive
- name: poem-openapi
registryName: poem-openapi
path: poem-openapi
- name: poem-grpc-build
registryName: poem-grpc-build
path: poem-grpc-build
- name: poem-grpc
registryName: poem-grpc
path: poem-grpc
steps:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout
uses: actions/checkout@v3
- name: Install Protoc
if: matrix.package.name == 'poem-grpc'
uses: arduino/setup-protoc@v1
- name: Get Version
working-directory: ${{ matrix.package.path }}
run: echo PACKAGE_VERSION=$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml) >> $GITHUB_ENV
- name: Check Published Version
run: echo PUBLISHED_VERSION=$(cargo search ${{ matrix.package.registryName }} --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -) >> $GITHUB_ENV
- name: Cargo Package
if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION
working-directory: ${{ matrix.package.path }}
run: |
cargo package
echo "We will publish:" $PACKAGE_VERSION
echo "This is current latest:" $PUBLISHED_VERSION

0 comments on commit 9769002

Please sign in to comment.