Bump async-trait from 0.1.86 to 0.1.87 #246
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
deb: | |
name: Deb package | |
env: | |
CARGO_DEB_VER: 1.38.2 | |
DEBIAN_FRONTEND: noninteractive | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
strategy: | |
matrix: | |
target: | |
- "x86_64-unknown-linux-gnu" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install common libs | |
run: | | |
sudo apt-get update | |
sudo apt-get install pkg-config libssl-dev lintian libpqxx-dev libxmlsec1-dev libclang-dev | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Get Rust toolchain channel | |
run: | | |
echo "RUST_CHANNEL=$(sed -nrE 's/^channel = "(.*)"$/\1/p' "$GITHUB_WORKSPACE"/rust-toolchain.toml)" >> $GITHUB_ENV | |
- name: Install Rust ${{ env.RUST_CHANNEL }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_CHANNEL }} | |
targets: ${{ matrix.target }} | |
- name: Install Cargo Deb | |
uses: actions-rs/[email protected] | |
with: | |
command: install | |
args: cargo-deb --vers=${{ env.CARGO_DEB_VER }} --locked | |
- name: Create package | |
uses: actions-rs/[email protected] | |
with: | |
command: deb | |
args: -p akr --target=${{ matrix.target }} | |
- name: Verify package | |
run: | | |
# do not use exit codes while errors occured | |
lintian -v target/${{ matrix.target }}/debian/*.deb || true | |
- name: Upload asset | |
uses: actions/[email protected] | |
with: | |
name: akr-deb | |
path: target/${{ matrix.target }}/debian/*.deb | |
rpm: | |
name: RPM package | |
env: | |
CARGO_GENERATE_RPM_VER: 0.7.0 | |
strategy: | |
matrix: | |
image: | |
- "alvistack/centos-9-stream" | |
runs-on: ubuntu-22.04 | |
container: | |
image: ${{ matrix.image }} | |
steps: | |
- name: Install libs on CentOS | |
if: startsWith(matrix.image, 'centos') | |
run: | | |
yum update -y && yum install -y epel-release && yum install -y gcc make cmake3 gcc-c++ openssl-devel gzip rpmlint | |
ln -s /usr/bin/cmake3 /usr/bin/cmake | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Get Rust toolchain channel | |
run: | | |
echo "RUST_CHANNEL=$(sed -nrE 's/^channel = "(.*)"$/\1/p' "$GITHUB_WORKSPACE"/rust-toolchain.toml)" >> $GITHUB_ENV | |
- name: Install Rust ${{ env.RUST_CHANNEL }} | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_CHANNEL }} | |
- name: Delete previous RPM | |
run: rm -f target/generate-rpm/*.rpm | |
- name: Install Cargo Generate RPM | |
uses: actions-rs/[email protected] | |
with: | |
command: install | |
args: cargo-generate-rpm --vers=${{ env.CARGO_GENERATE_RPM_VER }} --locked | |
- name: Build binary | |
uses: actions-rs/[email protected] | |
with: | |
command: build | |
args: --release | |
- name: Remove all symbol and relocation information | |
run: strip -s target/release/akr | |
- name: Add dist to release | |
run: dist=$(rpm --eval %{?dist}); sed -i -e 's/release = "\(.*\)"/release = "\1'$dist'"/g' Cargo.toml | |
- name: Create package | |
uses: actions-rs/[email protected] | |
with: | |
command: generate-rpm | |
args: -p crates/kr ${{ env.CENTOS_BUILD_FLAGS }} | |
- name: Verify package | |
run: | | |
# do not use exit codes while errors occured | |
rpmlint target/generate-rpm/akr-*.rpm || true | |
- name: Upload RPM | |
uses: actions/[email protected] | |
with: | |
name: akr-${{ matrix.image == 'alvistack/centos-9-stream' && 'centos-9-stream' || 'unknown' }} | |
path: target/generate-rpm/*.rpm |