Skip to content

bump version to v0.22.0 #26

bump version to v0.22.0

bump version to v0.22.0 #26

Workflow file for this run

name: release
on:
push:
tags: [ v*.*.* ]
jobs:
test:
name: Test
runs-on: ${{ matrix.job.os }}
timeout-minutes: 15
strategy:
matrix:
job:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
flags: --features=native-tls
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
flags: --no-default-features --features=native-tls,online-tests # disables rustls
- target: x86_64-apple-darwin
os: macos-latest
flags: --features=native-tls
- target: aarch64-apple-darwin
os: macos-14
flags: --features=native-tls
- target: x86_64-pc-windows-msvc
os: windows-latest
flags: --features=native-tls
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
use-cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
use-cross: true
flags: -- --test-threads=4
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
use-cross: true
flags: -- --test-threads=4
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.74.0 # minimum supported rust version
targets: ${{ matrix.job.target }}
- uses: ClementTsang/[email protected]
with:
use-cross: ${{ !!matrix.job.use-cross }}
command: test
args: --target ${{ matrix.job.target }} ${{ matrix.job.flags }}
deploy:
name: Deploy
needs: [ test ]
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
binutils: aarch64-linux-gnu
use-cross: true
- os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
binutils: arm-linux-gnueabihf
use-cross: true
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: true
- os: macos-latest
target: x86_64-apple-darwin
flags: --features=native-tls
- os: macos-14
target: aarch64-apple-darwin
flags: --features=native-tls
- os: windows-latest
target: x86_64-pc-windows-msvc
flags: --features=native-tls
rustflags: -C target-feature=+crt-static
steps:
- uses: actions/checkout@v4
- name: Set RUSTFLAGS env variable
if: matrix.job.rustflags
shell: bash
run: echo "RUSTFLAGS=${{ matrix.job.rustflags }}" >> $GITHUB_ENV
- name: Build target
uses: ClementTsang/[email protected]
with:
use-cross: ${{ !!matrix.job.use-cross }}
command: build
args: --release --target ${{ matrix.job.target }} ${{ matrix.job.flags }}
env:
CARGO_PROFILE_RELEASE_LTO: true
- name: Strip release binary (linux and macOS)
if: matrix.job.os != 'windows-latest'
run: |
if [ "${{ matrix.job.binutils }}" != "" ]; then
sudo apt -y install "binutils-${{ matrix.job.binutils }}"
"${{ matrix.job.binutils }}-strip" "target/${{ matrix.job.target }}/release/xh"
else
strip "target/${{ matrix.job.target }}/release/xh"
fi
- id: get_version
uses: battila7/get-version-action@v2
- name: Package
shell: bash
run: |
if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
bin="target/${{ matrix.job.target }}/release/xh.exe"
else
bin="target/${{ matrix.job.target }}/release/xh"
fi
staging="xh-${{ steps.get_version.outputs.version }}-${{ matrix.job.target }}"
mkdir -p "$staging"/{doc,completions}
cp LICENSE README.md $bin $staging
cp CHANGELOG.md doc/xh.1 "$staging"/doc
cp completions/* "$staging"/completions
if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
7z a "$staging.zip" $staging
elif [ "${{ matrix.job.os }}" = "macos-latest" ]; then
gtar czvf "$staging.tar.gz" $staging
else
tar czvf "$staging.tar.gz" $staging
fi
- name: Package (debian)
if: matrix.job.target == 'x86_64-unknown-linux-musl'
shell: bash
run: |
cargo install --git https://github.com/blyxxyz/cargo-deb --locked --branch xh-patches cargo-deb
cargo deb --no-build --target ${{ matrix.job.target }}
cp "target/${{ matrix.job.target }}/debian"/*.deb ./
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: 'xh*'
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}