-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (91 loc) · 3.11 KB
/
package.yml
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
name: package
on:
push:
paths:
- '.github/workflows/build_windows.bash'
- '.github/workflows/package.yml'
- 'custom-prompt/*'
workflow_dispatch:
jobs:
build_windows:
name: build on windows-2022
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
install: git make
pacboy: cmake gcc pkgconf
- uses: actions/checkout@v4
- run: .github/workflows/build_windows.bash
env:
CMAKE_INSTALL_PREFIX: C:/ProgramData/libgit2
name: Build statically-linked Windows binaries
- uses: actions/upload-artifact@v4
with:
name: custom-prompt-amd64-windows
path: 'custom-prompt/bin'
build_macos:
name: build on ${{ matrix.os.name }}
runs-on: ${{ matrix.os.name }}
strategy:
matrix:
os: [{name: 'macos-13', id: 'amd64-macos'}, {name: 'macos-14', id: 'aarch64-macos'}]
steps:
- uses: actions/checkout@v4
- run: brew install libgit2
- run: make -j release
working-directory: custom-prompt
name: Build dynamically-linked macOS binaries
- uses: actions/upload-artifact@v4
with:
name: custom-prompt-${{ matrix.os.id }}
path: 'custom-prompt/bin'
build_linux:
name: build on ${{ matrix.arch }}/${{ matrix.os.name }}:${{ matrix.os.tag }}
runs-on: ubuntu-22.04
container: ${{ matrix.arch }}/${{ matrix.os.name }}:${{ matrix.os.tag }}
strategy:
matrix:
arch: [amd64]
os: [{name: 'alpine', tag: '3.20', libc: 'musl'}, {name: 'debian', tag: '12', libc: 'gnu'}]
steps:
- uses: actions/checkout@v4
- if: matrix.os.name == 'alpine'
run: apk add build-base libgit2-dev libnotify-dev libx11-dev
- if: matrix.os.name == 'debian'
run: apt-get update && apt-get install -y build-essential libgit2-dev libnotify-dev libx11-dev
- run: make -j release
working-directory: custom-prompt
name: Build dynamically-linked Linux binaries
- uses: actions/upload-artifact@v4
with:
name: custom-prompt-${{ matrix.arch }}-linux-${{ matrix.os.libc }}
path: 'custom-prompt/bin'
release:
if: github.ref_type == 'tag'
needs: [build_windows, build_macos, build_linux]
runs-on: ubuntu-22.04
permissions: write-all
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: |
chmod --recursive +x .
for package_directory in custom-prompt-*
do
(
cd $package_directory
tar cfvz ${package_directory}.tgz *
)
done
name: Create compressed archives of binaries
- run: |
gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -n "Linux binaries require libnotify and libgit2, and macOS, just libgit2. Windows binaries are statically linked." --generate-notes
gh release upload ${{ github.ref_name }} */*.tgz
name: Publish release
env:
GH_TOKEN: ${{ github.token }}