Skip to content

Commit 4a6d1f6

Browse files
committed
Move GitHub Actions workflow to root directory
GitHub Actions only detects workflows in .github/workflows/ at the repository root. Moved from nexadb-cli-rust/.github/workflows/ to enable automated builds for nexa CLI.
1 parent cd93d04 commit 4a6d1f6

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release Rust CLI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'cli-v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build ${{ matrix.target }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
include:
16+
# macOS
17+
- os: macos-latest
18+
target: x86_64-apple-darwin
19+
artifact_name: nexa
20+
asset_name: nexa-x86_64-apple-darwin
21+
- os: macos-latest
22+
target: aarch64-apple-darwin
23+
artifact_name: nexa
24+
asset_name: nexa-aarch64-apple-darwin
25+
26+
# Linux
27+
- os: ubuntu-latest
28+
target: x86_64-unknown-linux-gnu
29+
artifact_name: nexa
30+
asset_name: nexa-x86_64-unknown-linux-gnu
31+
- os: ubuntu-latest
32+
target: aarch64-unknown-linux-gnu
33+
artifact_name: nexa
34+
asset_name: nexa-aarch64-unknown-linux-gnu
35+
36+
# Windows
37+
- os: windows-latest
38+
target: x86_64-pc-windows-msvc
39+
artifact_name: nexa.exe
40+
asset_name: nexa-x86_64-pc-windows-msvc.exe
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Install Rust
46+
uses: dtolnay/rust-toolchain@stable
47+
with:
48+
targets: ${{ matrix.target }}
49+
50+
- name: Install cross (Linux ARM only)
51+
if: matrix.target == 'aarch64-unknown-linux-gnu'
52+
run: cargo install cross
53+
54+
- name: Build
55+
run: |
56+
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
57+
cross build --release --target ${{ matrix.target }}
58+
else
59+
cargo build --release --target ${{ matrix.target }}
60+
fi
61+
shell: bash
62+
working-directory: nexadb-cli-rust
63+
64+
- name: Strip binary (Unix)
65+
if: matrix.os != 'windows-latest'
66+
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
67+
working-directory: nexadb-cli-rust
68+
69+
- name: Upload artifact
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: ${{ matrix.asset_name }}
73+
path: nexadb-cli-rust/target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
74+
75+
- name: Release
76+
uses: softprops/action-gh-release@v1
77+
if: startsWith(github.ref, 'refs/tags/')
78+
with:
79+
files: nexadb-cli-rust/target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)