Skip to content

.github/workflows/ci: Uptate the CI flow #51

.github/workflows/ci: Uptate the CI flow

.github/workflows/ci: Uptate the CI flow #51

Workflow file for this run

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@v2
with:
name: thrift-macos-12
path: dist/
- uses: actions/download-artifact@v2
with:
name: thrift-macos-14
path: dist/
- name: tar types
run: |
tar -cvf dist/types.tar types
- name: Create release
uses: upfluence/actions/create-github-release@master
with:
attachments: dist/*
version: ${{needs.compute-version.outputs.version}}