Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 27 additions & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,51 @@ permissions:
jobs:
publish:
name: Building ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
runs-on: ${{ matrix.platform.runs-on }}
strategy:
matrix:
rust: [stable]
job:
- os: macos-latest
os-name: macos
target: x86_64-apple-darwin
architecture: x86_64
binary-postfix: ""
use-cross: false
- os: ubuntu-latest
os-name: linux
target: x86_64-unknown-linux-gnu
architecture: x86_64
binary-postfix: ""
use-cross: false
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-msvc
architecture: x86_64
binary-postfix: ".exe"
use-cross: false
- os: ubuntu-latest
os-name: linux-musl
- os-name: Linux-x86_64
runs-on: ubuntu-20.04
target: x86_64-unknown-linux-musl
architecture: x86_64
binary-postfix: ""
use-cross: true
- os: ubuntu-latest
os-name: linux
target: aarch64-unknown-linux-gnu
architecture: arm64
binary-postfix: ""
use-cross: true
- os-name: Linux-aarch64
runs-on: ubuntu-20.04
target: aarch64-unknown-linux-musl
- os-name: Linux-riscv64
runs-on: ubuntu-20.04
target: riscv64gc-unknown-linux-gnu
- os-name: Windows-x86_64
runs-on: windows-latest
target: x86_64-pc-windows-msvc
- os-name: macOS-x86_64
runs-on: macOS-latest
target: x86_64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Cargo build
uses: actions-rs/cargo@v1
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
use-cross: ${{ matrix.job.use-cross }}
toolchain: ${{ matrix.rust }}
args: --release --target ${{ matrix.job.target }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
env:
JEMALLOC_SYS_WITH_MALLOC_CONF: "background_thread:true,metadata_thp:auto,tcache:false,dirty_decay_ms:30000,muzzy_decay_ms:30000,abort_conf:true"

- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.job.target }}/release
BINARY_NAME=rustus${{ matrix.job.binary-postfix }}

########## create tar.gz ##########
RELEASE_NAME=rustus-${{ github.ref_name }}-${{ matrix.job.os-name }}-${{ matrix.job.architecture }}
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME

########## create sha256 ##########
if [[ ${{ runner.os }} == 'Windows' ]]; then
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
else
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
fi
- name: Releasing assets
uses: softprops/action-gh-release@v1
- name: Publish artifacts and release
uses: houseabsolute/actions-rust-release@v0
with:
files: |
target/${{ matrix.job.target }}/release/rustus-*.tar.gz
target/${{ matrix.job.target }}/release/rustus-*.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
executable-name: rustus
target: ${{ matrix.platform.target }}

docker_build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update version
run: sed -i '0,/^version = .*/{s/version = .*/version = "${{ github.ref_name }}"/}' Cargo.toml
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
Expand All @@ -113,7 +73,7 @@ jobs:
push: true
file: ./Dockerfile
target: base
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ghcr.io/s3rius/rustus:latest,ghcr.io/s3rius/rustus:${{ github.ref_name }}
- name: Build and push rootless
uses: docker/build-push-action@v2
Expand Down
Loading
Loading