mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 05:07:55 +08:00
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
name: build-on-demand
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
target:
|
|
description: "Target"
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- aarch64-apple-darwin
|
|
- aarch64-unknown-linux-musl
|
|
- armv6l-unknown-linux-musleabihf
|
|
- armv7l-unknown-linux-musleabihf
|
|
- i686-unknown-linux-musl
|
|
- i686-w64-mingw32
|
|
- x86_64-apple-darwin
|
|
- x86_64-unknown-linux-musl
|
|
- x86_64-w64-mingw32
|
|
defaultFeatures:
|
|
description: "Enable default cargo features"
|
|
default: true
|
|
type: bool
|
|
features:
|
|
description: "Cargo features (comma-separated)"
|
|
type: string
|
|
|
|
jobs:
|
|
build-on-demand:
|
|
runs-on: ${{ inputs.target == "x86_64-apple-darwin" && "macos-13" || inputs.target == "aarch64-apple-darwin" && "macos-14" || "ubuntu-latest" }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
- name: Install Nix
|
|
uses: cachix/install-nix-action@v27
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-24.05
|
|
enable_kvm: true
|
|
- name: Cache Nix store
|
|
uses: cachix/cachix-action@v15
|
|
with:
|
|
name: soywod
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
extraPullNames: nix-community
|
|
- name: Build release
|
|
env:
|
|
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM: 1
|
|
run: |
|
|
nix-build \
|
|
--argstr target ${{ inputs.target }} \
|
|
--arg defaultFeatures ${{ inputs.defaultFeatures }} \
|
|
--argstr features ${{ inputs.features }}
|
|
- name: Upload release artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "himalaya.${{ inputs.target }}"
|
|
path: |
|
|
result/bin/himalaya*
|
|
result/bin/share
|