Skip to content

v0.28.1

v0.28.1 #16

Workflow file for this run

name: release
on:
release:
types: [created]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- stable
os:
- centos:7.4.1708
- centos:7.6.1810
- centos:7.7.1908
- centos:7.8.2003
- centos:7.9.2009
- ubuntu:18.04
- ubuntu:20.04
- ubuntu:22.04
- fedora:37
- fedora:38
- fedora:39
- debian:10
- debian:11
- debian:12
- rhel:8.6
- rhel:8.7
- rhel:8.8
- rhel:8.9
- rhel:9.0
- rhel:9.1
- rhel:9.2
- rhel:9.3
- almalinux:8.6
- almalinux:8.7
- almalinux:8.8
- almalinux:8.9
- almalinux:9.0
- almalinux:9.1
- almalinux:9.2
- almalinux:9.3
steps:
- uses: actions/checkout@v3
- name: OS Build
run: |
export full_tgtname=${{ matrix.os }}
export tgtname=$(echo ${{ matrix.os }} | tr -d ':')
.github/scripts/gen_dockerfile.sh
docker build ./ -t $tgtname
docker run \
-t --rm \
-v "$GITHUB_WORKSPACE:/source" \
-v "$GITHUB_WORKSPACE/target/$tgtname:/source/target" \
$tgtname \
cargo build --release;
shell: bash
- name: OS Create Package
run: |
tgtname=$(echo ${{ matrix.os }} | tr -d ':')
.github/scripts/package.sh $tgtname;
shell: bash
- name: Get Artifact Name
run: |
ARTIFACT_PATHNAME=$(ls ./bender-*.tar.gz | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
shell: bash
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz
release-gnu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
# Use container that supports old GLIBC versions and (hopefully) many linux OSs
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: GNU Build
run: cargo build --release
- name: GNU Create Package
run: .github/scripts/package.sh
shell: bash
- name: Get Artifact Name
run: |
ARTIFACT_PATHNAME=$(ls ./bender-*.tar.gz | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
shell: bash
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz
release-macos:
runs-on: macos-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: universal2 install
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
cargo install universal2
- name: MacOS Build
run: cargo-universal2 --release
- name: Get Artifact Name
run: |
if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then \
PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\/v//p'); \
else \
PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\///p'); \
fi
ARTIFACT_PATHNAME="bender-$PKG_VERSION-universal-apple-darwin.tar.gz"
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
- name: Create Package
run: |
gtar -czf $ARTIFACT_PATHNAME -C "./target/universal2-apple-darwin/release" --owner=0 --group=0 bender
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz
release-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build
run: cargo build --release
- name: Get Artifact Name
shell: bash
run: |
if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then \
PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\/v//p'); \
else \
PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\///p'); \
fi
ARTIFACT_PATHNAME="bender-$PKG_VERSION-x86_64-pc-windows-msvc.tar.gz"
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
- name: Create Package
run: |
cp target/release/bender.exe .
& 'C:\Program Files\Git\usr\bin\tar.exe' czf $Env:ARTIFACT_PATHNAME --owner=0 --group=0 bender.exe
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz