forked from hank9999/kiro.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (106 loc) · 3.42 KB
/
build.yaml
File metadata and controls
121 lines (106 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Build Artifacts
on:
push:
branches:
- master
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version label for artifacts (e.g., 2025.12.1)'
required: true
default: '2026.1.1'
permissions:
contents: read
jobs:
pre-check:
runs-on: ubuntu-latest
outputs:
should_build: ${{ steps.check.outputs.should_build }}
steps:
- uses: actions/checkout@v4
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
with:
fetch-depth: 0
- name: Check if commit has release tag
id: check
run: |
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == refs/heads/* ]] && git tag --points-at HEAD | grep -q '^v'; then
echo "should_build=false" >> $GITHUB_OUTPUT
echo "::notice::Skipping beta build: commit already has a release tag"
else
echo "should_build=true" >> $GITHUB_OUTPUT
fi
build:
needs: pre-check
if: needs.pre-check.outputs.should_build == 'true'
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
target: aarch64-apple-darwin
name: macOS-arm64
- platform: macos-latest
target: x86_64-apple-darwin
name: macOS-x64
- platform: windows-latest
target: x86_64-pc-windows-msvc
name: Windows-x64
- platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
name: Linux-x64
- platform: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
name: Linux-arm64
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Determine version
id: version
shell: bash
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-6)
echo "version=beta-${SHORT_SHA}" >> $GITHUB_OUTPUT
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install admin-ui dependencies
working-directory: admin-ui
run: pnpm install
- name: Build admin-ui
working-directory: admin-ui
run: pnpm build
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-${{ matrix.target }}"
cache-on-failure: true
- name: Build app
run: cargo build --release --target ${{ matrix.target }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: kiro-rs-${{ steps.version.outputs.version }}-${{ matrix.name }}
if-no-files-found: error
compression-level: 6
path: |
target/${{ matrix.target }}/release/kiro-rs
target/${{ matrix.target }}/release/kiro-rs.exe