1
1
name : ci
2
2
3
3
on :
4
- pull_request :
5
4
push :
6
5
branches :
7
- - ' v1.x'
8
6
- ' master'
9
- tags :
10
- - v*
7
+ pull_request :
11
8
12
9
jobs :
10
+ compute-version :
11
+ runs-on : ubuntu-20.04
12
+ outputs :
13
+ version : ${{ steps.bump-version.outputs.version }}
14
+ steps :
15
+ - name : Bump version
16
+ id : bump-version
17
+ uses : upfluence/actions/bump-version@master
18
+
13
19
build :
14
20
name : Build the thrift compiler
21
+ needs : compute-version
15
22
strategy :
16
23
matrix :
17
24
os : [ubuntu-20.04, macos-12, macos-14]
18
25
runs-on : ${{ matrix.os }}
19
26
steps :
20
27
- name : Checkout
21
- uses : actions/checkout@v2
28
+ uses : actions/checkout@v3
22
29
- name : Generate build configuration
30
+ env :
31
+ THRIFT_VERSION : ${{needs.compute-version.outputs.version}}
23
32
run : |
24
33
cmake \
34
+ -DTHRIFT_VERSION=${THRIFT_VERSION#v}-upfluence \
25
35
-DBUILD_COMPILER=ON \
26
36
-DBUILD_LIBRARIES=OFF \
27
37
-DBUILD_TESTING=OFF \
@@ -32,39 +42,40 @@ jobs:
32
42
cmake --build . --config Release
33
43
mv bin/thrift bin/thrift-${{ matrix.os }}
34
44
- name : Upload Binary
35
- uses : actions/upload-artifact@v2
45
+ uses : actions/upload-artifact@v4
36
46
with :
37
47
name : thrift-${{ matrix.os }}
38
- retention-days : 1
39
- path : |
40
- bin/*
48
+ retention-days : 2
49
+ path : bin/*
41
50
42
51
release :
43
52
name : " Release binaries"
44
53
runs-on : ubuntu-20.04
45
- needs : build
46
- if : contains(github.ref, 'refs/tags/v')
54
+ needs :
55
+ - compute-version
56
+ - build
57
+ if : contains('refs/heads/master', github.ref)
47
58
steps :
48
- - uses : actions/download-artifact@v2
59
+ - name : Checkout
60
+ uses : actions/checkout@v3
61
+ - uses : actions/download-artifact@v4
49
62
with :
50
63
name : thrift-ubuntu-20.04
51
- path : bin /
64
+ path : dist /
52
65
- uses : actions/download-artifact@v2
53
66
with :
54
67
name : thrift-macos-12
55
- path : bin /
68
+ path : dist /
56
69
- uses : actions/download-artifact@v2
57
70
with :
58
71
name : thrift-macos-14
59
- path : bin /
60
- - name : Get Package Version
61
- id : pkg_version
62
- run : echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
63
- - name : Create a new Release
64
- uses : marvinpinto/action-automatic-releases@v1.2.1
72
+ path : dist /
73
+ - name : tar types
74
+ run : |
75
+ tar -cvf dist/types.tar types
76
+ - name : Create release
77
+ uses : upfluence/actions/create-github-release@master
65
78
with :
66
- repo_token : ${{ secrets.GITHUB_TOKEN }}
67
- prerelease : false
68
- title : ${{ steps.pkg_version.outputs.VERSION }}
69
- files : |
70
- bin/*
79
+ attachments : dist/*
80
+ version : ${{needs.compute-version.outputs.version}}
81
+
0 commit comments