forked from liming123/BEPS_hourly_site_4.02
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (100 loc) · 2.96 KB
/
c-cpp.yml
File metadata and controls
114 lines (100 loc) · 2.96 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
name: C/C++ CI
on:
push:
branches: [ "master" ]
tags: [ "v*" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux-x86_64
os: ubuntu-latest
lib_src: libbeps.so
lib_dst: libbeps-linux-x86_64.so
exe_src: beps
exe_dst: beps-linux-x86_64
- platform: macos-x86_64
os: macos-15-intel
lib_src: libbeps.dylib
lib_dst: libbeps-macos-x86_64.dylib
exe_src: beps
exe_dst: beps-macos-x86_64
- platform: macos-arm64
os: macos-15
lib_src: libbeps.dylib
lib_dst: libbeps-macos-arm64.dylib
exe_src: beps
exe_dst: beps-macos-arm64
- platform: windows-x86_64
os: windows-latest
lib_src: libbeps.dll
lib_dst: libbeps-windows-x86_64.dll
exe_src: beps.exe
exe_dst: beps-windows-x86_64.exe
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: make mingw-w64-x86_64-gcc
- name: Build
if: runner.os != 'Windows'
shell: bash
run: make clean strip
- name: Build
if: runner.os == 'Windows'
shell: msys2 {0}
run: make clean strip
- name: Package
if: runner.os != 'Windows'
shell: bash
run: |
mkdir -p dist
cp "${{ matrix.lib_src }}" "dist/${{ matrix.lib_dst }}"
cp "${{ matrix.exe_src }}" "dist/${{ matrix.exe_dst }}"
tar -czf "dist/beps-${{ matrix.platform }}.tar.gz" -C dist "${{ matrix.lib_dst }}"
- name: Package
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir -p dist
cp "${{ matrix.lib_src }}" "dist/${{ matrix.lib_dst }}"
cp "${{ matrix.exe_src }}" "dist/${{ matrix.exe_dst }}"
tar -czf "dist/beps-${{ matrix.platform }}.tar.gz" -C dist "${{ matrix.lib_dst }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: beps-${{ matrix.platform }}
path: dist/*
if-no-files-found: error
#- name: make check
# run: make check
#- name: make distcheck
# run: make distcheck
release:
name: Publish release assets
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: dist/*