ver: 1.0.0rc #7
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
# This Github workflow will create a new release when a tag is pushed, | |
# then it will build the binary and it will add it to the release assets | |
# in a tar.gz archive along with other components. | |
# | |
# Reference: | |
# https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml | |
# https://github.com/rhino-linux/rhino-setup/blob/master/.github/workflows/package.yml | |
name: release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" | |
jobs: | |
create-release: | |
name: create-release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
version: ${{ github.ref_name }} | |
steps: | |
- name: Create Github Release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: ${{ github.ref_name }} | |
build-release: | |
name: build-release | |
needs: ["create-release"] | |
runs-on: ${{ matrix.os }} | |
env: | |
TARGET_DIR: ./target | |
# Emit backtraces on panics. | |
RUST_BACKTRACE: 1 | |
strategy: | |
matrix: | |
build: [x86_64-linux-gnu, x86_64-linux-musl] | |
# FIX: Building for arm and i686. | |
include: | |
- build: x86_64-linux-gnu | |
os: ubuntu-latest | |
rust: stable | |
target: x86_64-unknown-linux-gnu | |
- build: x86_64-linux-musl | |
os: ubuntu-latest | |
rust: stable | |
target: x86_64-unknown-linux-musl | |
# - build: i686-linux-gnu | |
# os: ubuntu-latest | |
# rust: stable | |
# target: i686-unknown-linux-musl | |
# - build: i686-linux-musl | |
# os: ubuntu-latest | |
# rust: stable | |
# target: i686-unknown-linux-musl | |
# - build: arm-linux-gnueabihf | |
# os: ubuntu-latest | |
# rust: stable | |
# target: arm-unknown-linux-gnueabihf | |
# - build: arm-linux-musleabihf | |
# os: ubuntu-latest | |
# rust: stable | |
# target: arm-unknown-linux-musleabihf | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
targets: ${{ matrix.target }} | |
- name: Install System Deps | |
shell: bash | |
# FIX: Install deps for arm and i686 | |
run: sudo apt install libdbus-1-dev desktop-file-utils gettext meson -y | |
# FIX: Building for arm and i686 with meson | |
- name: Setup | |
run: meson build | |
- name: Build | |
run: meson install -C build --destdir "builds/${{ matrix.target }}" | |
- name: Create Archive | |
shell: bash | |
run: | | |
archive="ianny-${{ needs.create-release.outputs.version }}-${{ matrix.target }}.tar.gz" | |
tar -C "build/builds/" --create "${{ matrix.target }}/" --gzip --file "$archive" | |
echo "ASSET=$archive" >> $GITHUB_ENV | |
- name: Upload Release Archive | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
asset_path: ${{ env.ASSET }} | |
asset_name: ${{ env.ASSET }} | |
asset_content_type: application/octet-stream |