-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (112 loc) · 4.68 KB
/
build-and-release.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-latest, windows-2022, windows-2019]
arch: [x64, x86]
include:
- os: ubuntu-latest
ostype: linux
install: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libboost-all-dev libboost-all-dev:i386 clang g++-multilib libc++-dev libc++abi-dev
- os: ubuntu-24.04
ostype: linux
install: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libboost-all-dev libboost-all-dev:i386 clang g++-multilib libc++-dev libc++abi-dev
- os: ubuntu-22.04
ostype: linux
install: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libboost-all-dev libboost-all-dev:i386 clang g++-multilib libc++-dev libc++abi-dev
- os: ubuntu-20.04
ostype: linux
install: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libboost-all-dev libboost-all-dev:i386 clang g++-multilib libc++-dev libc++abi-dev
- os: windows-latest
ostype: windows
install: |
choco install llvm
curl -L -o boost.zip https://storage.cmr.dev.br/boost.zip
unzip boost.zip -d boost
- os: windows-2022
ostype: windows
install: |
choco install llvm
curl -L -o boost.zip https://storage.cmr.dev.br/boost.zip
unzip boost.zip -d boost
- os: windows-2019
ostype: windows
install: |
choco install llvm
curl -L -o boost.zip https://storage.cmr.dev.br/boost.zip
unzip boost.zip -d boost
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Clang
if: matrix.ostype == 'windows'
uses: egor-tensin/setup-clang@v1
- name: Install dependencies
run: ${{ matrix.install }}
- name: Build - Windows (x64)
if: matrix.ostype == 'windows' && matrix.arch == 'x64'
run: clang++ -o cmr_cache.exe main.cpp -I./vendor/ -I./boost/ -L./boost/lib -llibboost_system-vc143-mt-x64-1_85 -std=c++17
- name: Build - Windows (x86)
if: matrix.ostype == 'windows' && matrix.arch == 'x86'
run: clang++ -o cmr_cache.exe main.cpp -I./vendor/ -I./boost/ -L./boost/lib -llibboost_system-vc143-mt-x32-1_85 -std=c++17 -m32
- name: Build - Linux (x64)
if: matrix.ostype != 'windows' && matrix.arch == 'x64'
run: clang++ -o cmr_cache main.cpp -I./vendor/ -I/usr/include/boost -L/usr/lib/x86_64-linux-gnu -lboost_system -lpthread -std=c++17
- name: Build - Linux (x86)
if: matrix.ostype != 'windows' && matrix.arch == 'x86'
run: clang++ -o cmr_cache main.cpp -I./vendor/ -I/usr/include/boost -L/usr/lib/i386-linux-gnu -lboost_system -lpthread -std=c++17 -m32
- name: Get the tag
run: echo "GITHUB_REF=${{ github.ref }}"
- name: Extract the tag name
id: extract_tag
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Archive - Windows
if: matrix.ostype == 'windows'
run: |
mkdir -p release
cp cmr_cache.exe release/
cp -r config/ release/
cp -r data/ release/
tar -czf cmr_cache_${{ matrix.os }}_${{ matrix.arch }}.tar.gz release
- name: Create Release Archive - Others OS
if: matrix.ostype != 'windows'
run: |
mkdir -p release
cp cmr_cache release/
cp -r config/ release/
cp -r data/ release/
tar -czf cmr_cache_${{ matrix.os }}_${{ matrix.arch }}.tar.gz release
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: cmr_cache_${{ matrix.os }}_${{ matrix.arch }}.tar.gz
asset_name: cmr_cache_${{ matrix.os }}_${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}