-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (112 loc) · 3.18 KB
/
Copy pathrelease.yml
File metadata and controls
130 lines (112 loc) · 3.18 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
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
tags:
- "v*"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
ci:
name: CI (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-linux
runner: ubuntu-latest
- target: aarch64-linux
runner: ubuntu-24.04-arm
- target: aarch64-macos
runner: macos-15
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Build Zig library
run: zig build -Doptimize=ReleaseFast
- name: Run Zig tests
run: zig build test
- name: Set up Erlang/Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "27"
elixir-version: "1.17"
- name: Run Elixir tests
env:
TAILWIND_COMPILER_PATH: "true"
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get
mix test
build_nif:
name: Build NIF (${{ matrix.target }})
needs: ci
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-linux
runner: ubuntu-latest
- target: aarch64-linux
runner: ubuntu-24.04-arm
- target: aarch64-macos
runner: macos-15
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Set up Erlang/Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "27"
elixir-version: "1.17"
- name: Build NIF
env:
TAILWIND_COMPILER_PATH: "true"
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get
mix compile
- name: Package NIF
run: |
NIF_FILE=$(find _build -name "Elixir.TailwindCompiler.NIF.so" -type f | head -1)
if [ -z "$NIF_FILE" ]; then
echo "ERROR: Could not find compiled NIF .so file"
find _build -name "*NIF*" -type f
exit 1
fi
echo "Found NIF at: $NIF_FILE"
mkdir -p release
cp "$NIF_FILE" release/Elixir.TailwindCompiler.NIF.so
cd release
tar czf "tailwind_compiler-nif-${{ matrix.target }}.tar.gz" Elixir.TailwindCompiler.NIF.so
shasum -a 256 "tailwind_compiler-nif-${{ matrix.target }}.tar.gz" | tee "tailwind_compiler-nif-${{ matrix.target }}.tar.gz.sha256"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nif-${{ matrix.target }}
path: release/tailwind_compiler-nif-*
release:
name: Create Release
needs: build_nif
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
generate_release_notes: true