Github workflow update #108
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: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'New tag name' | |
required: true | |
push: | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
vendored_archive: | |
name: Vendored archive | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code checkout | |
uses: actions/checkout@v4 | |
- name: Create release directory | |
run: rsync -rv --exclude=.git . ../pulsar-${{ github.event.ref }} | |
- name: Cargo vendor | |
working-directory: ../pulsar-${{ github.event.ref }} | |
run: | | |
mkdir ../vendor-cargo-home | |
export CARGO_HOME=$(realpath ../vendor-cargo-home) | |
mkdir -p .cargo | |
cargo vendor >> .cargo/config.toml | |
- name: Create vendored source archive | |
working-directory: ../ | |
run: tar cJf pulsar-${{ github.event.ref }}.tar.xz pulsar-${{ github.event.ref }} | |
- name: Upload to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: ../pulsar-${{ github.event.ref }}.tar.xz | |
body: | | |
<hr> | |
Check out the [changelog](https://github.com/Exein-io/pulsar/blob/main/CHANGELOG.md) for details on all the changes and fixes. | |
binary: | |
name: Binary | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- target: x86_64-unknown-linux-gnu | |
args: "--features full" | |
docker-platform: linux/amd64 | |
# For `musl` builds openssl must be vendored | |
- target: x86_64-unknown-linux-musl | |
args: "--features full --features openssl-vendored" | |
- target: aarch64-unknown-linux-gnu | |
args: "--features full" | |
docker-platform: linux/arm64 | |
# For `musl` builds openssl must be vendored | |
- target: aarch64-unknown-linux-musl | |
args: "--features full --features openssl-vendored" | |
# Dependencies of `xtask` might fail to build on riscv64. | |
- target: riscv64gc-unknown-linux-gnu | |
args: "--features full" | |
docker-platform: linux/riscv64 | |
steps: | |
- name: Code checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain (stable) | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
target: ${{ matrix.platform.target }} | |
- name: Install cross | |
uses: ./.github/actions/install-cross | |
- name: Build Release | |
run: cross build --locked --target=${{ matrix.platform.target }} --bin pulsar-exec ${{ matrix.platform.args }} --release | |
- name: Create and push Docker image | |
uses: docker/build-push-action@v5 | |
if: ${{ matrix.platform.docker-platform == null }} | |
with: | |
context: ./target/${{ matrix.platform.target }}/release | |
file: ../docker/Dockerfile | |
tags: pulsar-exec | |
platforms: ${{ matrix.platform.docker-platform }} | |
push: false | |
outputs: type=image,name=target | |
- name: Rename binary | |
shell: bash | |
id: rename_binary | |
run: | | |
IFS='-' read -a arch <<< ${{ matrix.platform.target }} | |
suffix="" | |
if [[ "${{ matrix.platform.target }}" == *"musl"* ]]; then suffix="-static"; fi | |
binary_name=./target/${{ matrix.platform.target }}/release/pulsar-exec-${arch}${suffix} | |
mv ./target/${{ matrix.platform.target }}/release/pulsar-exec ${binary_name} | |
echo "binary_name=${binary_name}" >> $GITHUB_OUTPUT | |
- name: Upload to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: ${{ steps.rename_binary.outputs.binary_name }} | |
body: | | |
<hr> | |
Check out the [changelog](https://github.com/Exein-io/pulsar/blob/main/CHANGELOG.md) for details on all the changes and fixes. |