bump version to v0.19.3 #21
Workflow file for this run
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: release | |
on: | |
push: | |
tags: [ v*.*.* ] | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.job.os }} | |
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: 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@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.64.0 # minimum supported rust version | |
target: ${{ matrix.job.target }} | |
override: true | |
- uses: actions-rs/cargo@v1 | |
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: windows-latest | |
target: x86_64-pc-windows-msvc | |
flags: --features=native-tls | |
rustflags: -C target-feature=+crt-static | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set RUSTFLAGS env variable | |
if: matrix.job.rustflags | |
shell: bash | |
run: echo "RUSTFLAGS=${{ matrix.job.rustflags }}" >> $GITHUB_ENV | |
- name: Build target | |
uses: actions-rs/cargo@v1 | |
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/ducaale/cargo-deb --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 }} |