Repository navigation
77 lines (65 loc) · 2.21 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (65 loc) · 2.21 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
zig: ['0.14.0']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ matrix.zig }}
- name: Install deps (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libsecp256k1-dev pkg-config
- name: Install deps (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install secp256k1 pkg-config
- name: Install deps (Windows via vcpkg)
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
if [ ! -d "C:/vcpkg" ]; then
git clone --depth 1 https://github.com/microsoft/vcpkg C:/vcpkg
C:/vcpkg/bootstrap-vcpkg.bat
fi
C:/vcpkg/vcpkg install secp256k1:x64-windows-static
echo "C:/vcpkg/installed/x64-windows-static/include" >> $GITHUB_PATH
echo "C:/vcpkg/installed/x64-windows-static/lib" >> $GITHUB_PATH
- name: Build (ReleaseSafe - Windows)
if: startsWith(matrix.os, 'windows')
run: zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-windows-msvc -Dsecp256k1_include="C:/vcpkg/installed/x64-windows-static/include" -Dsecp256k1_lib="C:/vcpkg/installed/x64-windows-static/lib"
- name: Build (ReleaseSafe - Unix)
if: "!startsWith(matrix.os, 'windows')"
run: zig build -Doptimize=ReleaseSafe
- name: Package artifact
shell: bash
run: |
cd zig-out/bin
if [ "$RUNNER_OS" = "Windows" ]; then
7z a ../../zigchat-${{ runner.os }}.zip *
else
tar -czf ../../zigchat-${{ runner.os }}.tar.gz *
fi
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
zigchat-*.zip
zigchat-*.tar.gz
fail_on_unmatched_files: false