-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 2.52 KB
/
main.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
name: build & package
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Build:
# convert this to a matrix if builds differ between platforms
strategy:
matrix:
os: ['ubuntu-22.04']
mode: ['release', 'debug']
runs-on: ${{ matrix.os }}
steps:
- name: Checking out the repo
uses: actions/checkout@v4
## Windows ##
- name: Setup MSYS2 in Windows
if: ${{ startsWith(matrix.os, 'windows') }}
uses: msys2/setup-msys2@v2
# https://github.com/msys2/setup-msys2?tab=readme-ov-file#build-matrix
with:
msystem: CLANG64
pacboy: make diffutils patch clang:p # gcc:p
- name: Building in Windows
if: ${{ startsWith(matrix.os, 'windows') }}
shell: msys2 {0}
run: |
(cd "$(dirname "$(which clang)")" && ln -s clang gcc && ln -s clang++ g++)
sh build.sh
## Linux/Ubuntu ##
- name: Show info on Ubuntu
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: dpkg -l | grep -E ' gcc| clang'
- name: Building in Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }}
env:
- BUILD_MODE: ${{ matrix.mode }}
- CC: clang-15
- CXX: clang-15++
run: sh build.sh
## macOS ##
- name: Building in macOS
if: ${{ startsWith(matrix.os, 'macos') }}
run: sh build.sh
## General ##
- name: Upload log for debugging configure step
if: always()
uses: actions/upload-artifact@v4
with:
path: config.log
- name: Quick test
shell: sh
run: |
TCLSH=$(find ./sasfit-tcl/bin/ -type f -name 'tclsh8.4*')
echo "puts hello_world; exit;" | $TCLSH
- name: Upload package for publishing job
uses: actions/upload-artifact@v4
with:
name: package-${{ matrix.os }}
path: |
*.tar.xz
Publish:
needs: [Build]
runs-on: 'ubuntu-latest'
steps:
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
pattern: package-*
merge-multiple: true
path: dist
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*.tar.xz