forked from apache/thrift
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (90 loc) · 2.54 KB
/
ci.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
name: ci
on:
push:
branches:
- 'master'
pull_request:
jobs:
compute-version:
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.bump-version.outputs.version }}
steps:
- name: Bump version
id: bump-version
uses: upfluence/actions/bump-version@master
build:
name: Build the thrift compiler
needs: compute-version
strategy:
matrix:
os: [ubuntu-20.04, macos-12, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate build configuration
env:
THRIFT_VERSION: ${{ needs.compute-version.outputs.version }}
run: |
cmake \
-DTHRIFT_VERSION=${THRIFT_VERSION#v}-upfluence \
-DBUILD_COMPILER=ON \
-DBUILD_LIBRARIES=OFF \
-DBUILD_TESTING=OFF \
-DTYPES_PREFIX=${HOME} \
-DBUILD_EXAMPLES=OFF
- name: Build
run: |
cmake --build . --config Release
mv bin/thrift bin/thrift-${{ matrix.os }}
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: thrift-${{ matrix.os }}
retention-days: 2
path: bin/*
release:
name: "Release binaries"
runs-on: ubuntu-20.04
needs:
- compute-version
- build
if: contains('refs/heads/master', github.ref)
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: thrift-ubuntu-20.04
path: dist/
- uses: actions/download-artifact@v4
with:
name: thrift-macos-12
path: dist/
- uses: actions/download-artifact@v4
with:
name: thrift-macos-14
path: dist/
- name: tar types
run: |
tar -cvf dist/types.tar types
- name: move thrift-docker
run: |
cp contrib/thrift-docker dist
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker container
uses: upfluence/actions/build-docker@master
with:
version: ${{ needs.compute-version.outputs.version }}
registries: ghcr.io
- name: Create release
uses: upfluence/actions/create-github-release@master
with:
attachments: dist/*
version: ${{ needs.compute-version.outputs.version }}