-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (107 loc) · 3.39 KB
/
pull_request.yml
File metadata and controls
119 lines (107 loc) · 3.39 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
name: CI
on:
pull_request:
branches: [main]
paths-ignore:
- '**/*.md'
push:
tags:
- v*
paths-ignore:
- '**/*.md'
env:
BOOST_VERSION: 1.81.0
jobs:
build:
name: "Build ${{ matrix.config.os }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: "ubuntu-18.04"
std: "17"
- os: "ubuntu-20.04"
std: "17"
- os: "ubuntu-22.04"
std: "17"
steps:
- id: config
name: Generate Artefact name
run: |
artefact_name="boost-${{ env.BOOST_VERSION }}-cpp${{ matrix.config.std }}-${{ matrix.config.os }}-x64.tar.gz"
echo "artefact_name=$artefact_name" >> $GITHUB_OUTPUT
- name: Checkout Boost
uses: actions/checkout@v3
with:
repository: boostorg/boost
ref: boost-${{ env.BOOST_VERSION }}
path: boost
submodules: recursive
- name: Build Boost
working-directory: boost
run: |
./bootstrap.sh --prefix="${{ github.workspace }}/opt/boost${{ matrix.config.std }}"
./b2 -j$(nproc) install cxxflags="-std=c++${{ matrix.config.std }} -fPIC" linkflags="-std=c++${{ matrix.config.std }} -fPIC" link=static
- name: Archive boost
working-directory: ${{ github.workspace }}/opt
run: cmake -E tar cJfv "${{ steps.config.outputs.artefact_name }}" boost${{ matrix.config.std }}
- name: Upload artefact
uses: actions/upload-artifact@v3
with:
name: "${{ steps.config.outputs.artefact_name }}"
path: "${{ github.workspace }}/opt/${{ steps.config.outputs.artefact_name }}"
release:
if: contains(github.ref, 'tags/v')
name: Create Release
runs-on: ubuntu-latest
needs: build
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
publish:
if: contains(github.ref, 'tags/v')
name: "Publish ${{ matrix.config.os }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: "ubuntu-18.04"
std: "17"
- os: "ubuntu-20.04"
std: "17"
- os: "ubuntu-22.04"
std: "17"
needs: release
steps:
- id: config
run: |
artefact_name="boost-${{ env.BOOST_VERSION }}-cpp${{ matrix.config.std }}-${{ matrix.config.os }}-x64.tar.gz"
echo "artefact_name=$artefact_name" >> $GITHUB_OUTPUT
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: "${{ steps.config.outputs.artefact_name }}"
path: ./
- name: Upload to Release
id: upload_to_release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: "./${{ steps.config.outputs.artefact_name }}"
asset_name: "${{ steps.config.outputs.artefact_name }}"
asset_content_type: application/x-gtar