Skip to content

Commit

Permalink
ci: build pipeline with cross-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
nicotsx committed Jan 20, 2024
1 parent d9ea620 commit b4720c1
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Release CLI

on:
workflow_dispatch:
inputs:
version:
required: true
type: string
description: "The version of the CLI to build (e.g. v1.6.0-beta.1)"

jobs:
build:
name: Release - ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
bin: runtipi-cli
name: runtipi-cli-Linux-aarch64.tar.gz
command: build

- release_for: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: runtipi-cli
name: runtipi-cli-Linux-x86_64.tar.gz
command: build

- release_for: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: runtipi-cli
name: runtipi-cli-Darwin-aarch64.tar.gz
command: build

runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set version in src/assets/VERSION
run: |
echo "${{ inputs.version }}" > src/assets/VERSION
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true

- name: Upload CLI
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}
path: target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}

release:
runs-on: ubuntu-latest
needs: build
steps:
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ inputs.version }}

- name: Create release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
release_name: ${{ inputs.version }}
draft: false
prerelease: true

- name: Download CLI artifacts
uses: actions/download-artifact@v2
with:
name: runtipi-cli-*.tar.gz

0 comments on commit b4720c1

Please sign in to comment.