forked from FarGroup/FarManager
-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (184 loc) · 6.37 KB
/
build-llvm.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# build-llvm.yml
# 2024-03-04 00:40
name: Build-llvm
on:
# push:
# branches: master
# pull_request:
# branches: master
workflow_dispatch:
inputs:
extra_plugins_profile:
default: true
type: boolean
archive_src:
description: 'archive_src'
type: boolean
default: false
required: true
archive_ALL:
description: 'archive_ALL'
type: boolean
default: false
required: true
env:
PRG_NAME: "Far3-llvm"
PRG_VERSION: "3.0.0000.0"
Far_version: "3.0."
TAG_NAME: "Far3-llvm"
TAG_VERSION: "Far3-v1.0.0"
TAG_BUILD: "-b"
TAG_REF: "0000000"
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
jobs:
#------------------------------------------------------------------------------
build-llvm-mingw:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
machine_target: [i686, x86_64, armv7, aarch64]
c_lib: [msvcrt, ucrt]
build_type: [Release]
exclude:
- machine_target: armv7
c_lib: msvcrt
- machine_target: aarch64
c_lib: msvcrt
name: build-llvm_${{ matrix.machine_target }}_${{ matrix.c_lib }}_${{ matrix.build_type }}
env:
GCC_PREFIX: ${{ matrix.machine_target }}-w64-mingw32-
CLANG: 1
PYTHON: 1
SYS_LUA: 1
LUA_VER: '5.1.5'
ENABLE_TESTS: 0
steps:
- name: Checkout source
uses: deep-soft/checkout@v4
- name: Get ref, set build version
continue-on-error: false
shell: bash
run: |
_ref_all_=$(git log -1 --format='%H')
# _ref_=$(echo ${_ref_all_::7})
_ref_org_=${{ env.TAG_REF }}
_ref_len_="${#_ref_org_}"
_ref_=$(echo ${_ref_all_::$_ref_len_})
Far_version=${{ env.Far_version }}
Far_build=$(cat "far/vbuild.m4")
echo $Far_version$Far_build
echo "VERSION=$Far_version$Far_build.0" >> $GITHUB_ENV
_prg_version_="$Far_version$Far_build.0"
echo "TAG_REF=$_ref_" >> $GITHUB_ENV
_crt_date_=$(date "+%Y%m%d_%H%M")
_build_="$_crt_date_${{ env.TAG_BUILD }}.$_ref_"
echo "TAG_BUILD=$_build_" >> $GITHUB_ENV
echo "PRG_VERSION=$_prg_version_" >> $GITHUB_ENV
echo "TAG_VERSION=${{ env.PRG_NAME }}-$_prg_version_" >> $GITHUB_ENV
- name: Print ref, build version
shell: bash
run: |
echo "NAM: ${{ env.PRG_NAME }}"
echo "VER: ${{ env.PRG_VERSION }}"
echo "TAG: ${{ env.TAG_VERSION }}"
echo "REF: ${{ env.TAG_REF }}"
echo "BLD: ${{ env.TAG_BUILD }}"
echo "${{ env.PRG_NAME }}-${{ env.PRG_VERSION }}-${{ env.TAG_BUILD }}" > _version_.txt
- name: set folder_name and tag_name
shell: bash
run: |
case ${{ matrix.machine_target }} in
i686)
folder_name="far/${{ matrix.build_type }}.32.clang";
;;
x86_64)
folder_name="far/${{ matrix.build_type }}.64.clang";
;;
armv7)
folder_name="far/${{ matrix.build_type }}.ARM32.clang";
;;
aarch64)
folder_name="far/${{ matrix.build_type }}.ARM64.clang";
;;
esac
echo "FOLDER_NAME=$folder_name" >> $GITHUB_ENV
- name: Install luver
uses: deep-soft/luver-action@v1
- name: Install lua ${{ env.LUA_VER }}
run: |
luver install lua $LUA_VER
luver use $LUA_VER
- name: Download llvm-mingw
id: download_llvm_mingw
uses: deep-soft/[email protected]
#preRelease: true
with:
repository: "mstorsjo/llvm-mingw"
latest: true
fileName: "llvm-mingw-*-${{ matrix.c_lib }}-ubuntu-*-x86_64.tar.xz"
- name: Install llvm-mingw
run: |
LLVM_MINGW=${{ fromJson(steps.download_llvm_mingw.outputs.downloaded_files)[0] }}
tar -xf "$LLVM_MINGW"
rm -f "$LLVM_MINGW"
echo "${{ github.workspace }}/$(basename -s .tar.xz $LLVM_MINGW)/bin" >> $GITHUB_PATH
- name: Build far
working-directory: far
run: |
${GCC_PREFIX}clang --version
make -j $(($(nproc)+1)) -f makefile_gcc
- name: Build plugins
working-directory: plugins
run: |
${GCC_PREFIX}clang --version
make -j $(($(nproc)+1)) -f makefile_all_gcc
# release - begin
- name: Create Zip Archive Release
if: matrix.build_type == 'Release'
continue-on-error: true
uses: deep-soft/zip-release@v3
with:
type: 'zip'
filename: '${{ env.PRG_NAME }}.${{ matrix.machine_target }}.${{ matrix.c_lib}}.${{ env.PRG_VERSION }}'
directory: '${{ env.FOLDER_NAME }}'
exclusions: '*.map *.pdb'
recursive_exclusions: '*.map *.pdb changelog *Bel.lng *Cze.lng *Ger.lng *Hun.lng *Ita.lng *Lit.lng *Pol.lng *Rus.lng *Sky.lng *Spa.lng *Ukr* *Bel.hlf *Cze.hlf *Ger.hlf *Hun.hlf *Ita.hlf *Lit.hlf *Pol.hlf *Rus.hlf *Sky.hlf *Spa.hlf *Ukr*'
path: '.'
env_variable: 'ZIP_ARCHIVE_RELEASE'
- name: Publish
if: matrix.build_type == 'Release'
continue-on-error: true
uses: deep-soft/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}-${{ env.PRG_VERSION }}
files: |
${{ env.ZIP_ARCHIVE_RELEASE }}
_version_.txt
# release - end
# zip release begin
- name: Create Archive ALL
if: ${{ inputs.archive_ALL}}
continue-on-error: true
uses: deep-soft/zip-release@v3
with:
type: 'zip'
filename: '${{ env.PRG_NAME }}.${{ matrix.machine_target }}.${{ matrix.c_lib}}.${{ env.PRG_VERSION }}-ALL'
directory: '.'
path: '.'
exclusions: '*.git* /*node_modules/* .editorconfig'
env_variable: 'ZIP_ARCHIVE_ALL'
# archive name is ${{ env.ZIP_ARCHIVE_RELEASE }}
- name: Publish Archive ALL
if: ${{ inputs.archive_ALL}}
continue-on-error: true
uses: deep-soft/[email protected]
with:
draft: true
tag_name: ${{ env.TAG_VERSION }}${{ env.TAG_BUILD }}-ALL
files: |
${{ env.ZIP_ARCHIVE_ALL }}
_version_.txt
# zip release end