-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (96 loc) · 3.33 KB
/
Copy pathci-030.yml
File metadata and controls
100 lines (96 loc) · 3.33 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
name: build-and-pack-0.30-alpha
permissions:
contents: read
packages: write
on:
workflow_dispatch:
jobs:
native:
name: native-${{ matrix.rid }}-030
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
libname: libratatui_ffi.so
target: x86_64-unknown-linux-gnu
- os: windows-latest
rid: win-x64
libname: ratatui_ffi.dll
- os: macos-14
rid: osx-arm64
libname: libratatui_ffi.dylib
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Switch FFI to 0.30 branch
run: |
git -C native/ratatui-ffi fetch --all
git -C native/ratatui-ffi checkout ratatui-0.30
- uses: dtolnay/rust-toolchain@stable
- name: Build native (targeted)
if: ${{ matrix.target != '' }}
working-directory: native/ratatui-ffi
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
- name: Build native (default)
if: ${{ matrix.target == '' }}
working-directory: native/ratatui-ffi
run: cargo build --release
- name: Upload native artifact
uses: actions/upload-artifact@v4
with:
name: native-${{ matrix.rid }}
path: |
native/ratatui-ffi/target/release/${{ matrix.libname }}
native/ratatui-ffi/target/${{ matrix.target }}/release/${{ matrix.libname }}
if-no-files-found: warn
pack:
name: pack-nuget-030-alpha
runs-on: ubuntu-latest
needs: native
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Switch FFI to 0.30 branch
run: git -C native/ratatui-ffi checkout ratatui-0.30
- name: Download native artifacts
uses: actions/download-artifact@v4
with:
path: native_out
- name: Prepare runtimes directory
run: |
mkdir -p src/Ratatui/runtimes/linux-x64/native
mkdir -p src/Ratatui/runtimes/win-x64/native
mkdir -p src/Ratatui/runtimes/osx-arm64/native
cp native_out/native-linux-x64/libratatui_ffi.so src/Ratatui/runtimes/linux-x64/native/ || true
cp native_out/native-win-x64/ratatui_ffi.dll src/Ratatui/runtimes/win-x64/native/ || true
cp native_out/native-osx-arm64/libratatui_ffi.dylib src/Ratatui/runtimes/osx-arm64/native/ || true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Pack alpha
run: |
VER=0.2.0-alpha.${{ github.run_number }}
dotnet pack src/Ratatui/Ratatui.csproj -c Release -o artifacts -p:PackageVersion=$VER
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: nuget-030-alpha
path: artifacts/*.nupkg
- name: Publish to GitHub Packages
env:
OWNER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for pkg in artifacts/*.nupkg; do
dotnet nuget push "$pkg" \
--source "https://nuget.pkg.github.com/${OWNER}/index.json" \
--api-key "$GITHUB_TOKEN" \
--skip-duplicate
done