Skip to content

Commit 8a5bb3d

Browse files
.github/workflows/ci: Uptate the CI flow
1 parent e64f87a commit 8a5bb3d

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

.github/workflows/ci.yml

+36-25
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
name: ci
22

33
on:
4-
pull_request:
54
push:
65
branches:
7-
- 'v1.x'
86
- 'master'
9-
tags:
10-
- v*
7+
pull_request:
118

129
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+
1319
build:
1420
name: Build the thrift compiler
21+
needs: compute-version
1522
strategy:
1623
matrix:
1724
os: [ubuntu-20.04, macos-12, macos-14]
1825
runs-on: ${{ matrix.os }}
1926
steps:
2027
- name: Checkout
21-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2229
- name: Generate build configuration
30+
env:
31+
THRIFT_VERSION: ${{needs.compute-version.outputs.version}}
2332
run: |
2433
cmake \
34+
-DTHRIFT_VERSION=${THRIFT_VERSION#v}-upfluence \
2535
-DBUILD_COMPILER=ON \
2636
-DBUILD_LIBRARIES=OFF \
2737
-DBUILD_TESTING=OFF \
@@ -32,39 +42,40 @@ jobs:
3242
cmake --build . --config Release
3343
mv bin/thrift bin/thrift-${{ matrix.os }}
3444
- name: Upload Binary
35-
uses: actions/upload-artifact@v2
45+
uses: actions/upload-artifact@v4
3646
with:
3747
name: thrift-${{ matrix.os }}
38-
retention-days: 1
39-
path: |
40-
bin/*
48+
retention-days: 2
49+
path: bin/*
4150

4251
release:
4352
name: "Release binaries"
4453
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)
4758
steps:
48-
- uses: actions/download-artifact@v2
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
- uses: actions/download-artifact@v4
4962
with:
5063
name: thrift-ubuntu-20.04
51-
path: bin/
64+
path: dist/
5265
- uses: actions/download-artifact@v2
5366
with:
5467
name: thrift-macos-12
55-
path: bin/
68+
path: dist/
5669
- uses: actions/download-artifact@v2
5770
with:
5871
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
6578
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

Comments
 (0)