forked from liblouis/liblouis
-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (161 loc) · 7.18 KB
/
mingw.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
name: Cross-compile with mingw
on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- '**.h'
- '**.c'
- 'liblouis/liblouis/liblouis.h.in'
pull_request:
branches: [ master ]
paths:
- '**.h'
- '**.c'
- 'liblouis/liblouis/liblouis.h.in'
env:
LIBYAML_VERSION: 0.1.4
jobs:
build:
name: Build for win64
runs-on: ubuntu-latest
env:
HOST: x86_64-w64-mingw32
PREFIX: /tmp/build/win64
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y autoconf automake curl libtool make mingw-w64 pkg-config texinfo wine64 zip patch jq
- name: Build libyaml
run: |
curl -L https://github.com/yaml/libyaml/archive/${{ env.LIBYAML_VERSION }}.tar.gz | tar zx
cd libyaml-${{ env.LIBYAML_VERSION }}
patch -p1 < ../libyaml_mingw.patch
./bootstrap
./configure --host ${{ env.HOST }} --prefix=${{ env.PREFIX }}
make
make install
- name: Autogen && configure
run: |
./autogen.sh
./configure --host ${{ env.HOST }} --enable-ucs4 --prefix=${{ env.PREFIX }} CPPFLAGS="-I${{ env.PREFIX }}/include/" LDFLAGS="-L${{ env.PREFIX }}/lib/"
- name: Make
run: make LDFLAGS="-L${{ env.PREFIX }}/lib/ -avoid-version -Xcompiler -static-libgcc"
- name: Check
run: make check WINE=wine64
- name: Store the test suite log
if: ${{ failure() }}
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: test-suite-w64.log
path: tests/test-suite.log
- name: Install
run: make install
- name: Zip up the build artifacts
run: ( cd ${{ env.PREFIX }}; zip -r liblouis.zip * )
- name: Archive the build artifacts
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: liblouis-w64.zip
path: ${{ env.PREFIX }}/liblouis.zip
- name: Upload the assets to the snapshot release
# only upload to snapshot page if it is a push to master in the main repo
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
uses: shogo82148/actions-upload-release-asset@aac270e08f6b4547ada0b3800f88e1eb3ce9d400 # v1.7.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
upload_url: https://uploads.github.com/repos/liblouis/liblouis/releases/8031256/assets{?name,label}
asset_path: ${{ env.PREFIX }}/liblouis.zip
asset_name: liblouis-w64.zip
asset_content_type: application/zip
overwrite: true
- name: Edit the description of the snapshot release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
run: |
if ! curl -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X PATCH \
"https://api.github.com/repos/liblouis/liblouis/releases/8031256" \
-d "{\"tag_name\": \"snapshot\", \
\"body\": \"Latest build: ${{ github.sha }}\"}" \
2>/dev/null \
| jq -e '.url'; \
then \
echo "Failed to edit release description" && \
exit 1; \
fi
# win32 build disabled for now: see https://github.com/liblouis/liblouis/issues/1135
#build-w32:
# name: Build for win32
#
# runs-on: ubuntu-latest
# env:
# HOST: i686-w64-mingw32
# PREFIX: /tmp/build/win32
#
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
# with:
# egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
#
# - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# - name: Install dependencies
# run: sudo apt-get update -qq && sudo apt-get install -y autoconf automake curl libtool make pkg-config texinfo zip patch
# - name: Install wine for 32-bit architecture
# run: |
# sudo apt-get update -qq
# sudo dpkg --add-architecture i386
# sudo apt-get update
# sudo apt-get install -y fonts-wine libc6-dev-i386-x32-cross mingw-w64 mingw-w64-i686-dev wine-development wine32 # FIXME: in 20.4 wine-development will be just wine
#
# - name: Build libyaml
# run: |
# curl -L https://github.com/yaml/libyaml/archive/${{ env.LIBYAML_VERSION }}.tar.gz | tar zx
# cd libyaml-${{ env.LIBYAML_VERSION }}
# patch -p1 < ../libyaml_mingw.patch
# ./bootstrap
# ./configure --host ${{ env.HOST }} --prefix=${{ env.PREFIX }}
# make
# make install
# - name: Autogen && configure
# run: |
# ./autogen.sh
# ./configure --host ${{ env.HOST }} --enable-ucs4 --prefix=${{ env.PREFIX }} CFLAGS="-O0" CPPFLAGS="-I${{ env.PREFIX }}/include/" LDFLAGS="-L${{ env.PREFIX }}/lib/"
# - name: Make
# run: make LDFLAGS="-L${{ env.PREFIX }}/lib/ -avoid-version -Xcompiler -static-libgcc"
# - name: Check
# run: make check WINE=wine
# - name: Store the test suite log
# if: ${{ failure() }}
# uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
# with:
# name: test-suite-w32.log
# path: tests/test-suite.log
# - name: Install
# run: make install
#
# - name: Zip up the build artifacts
# run: ( cd ${{ env.PREFIX }}; zip -r liblouis.zip * )
# - name: Archive the build artifacts
# uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
# with:
# name: liblouis-w32.zip
# path: ${{ env.PREFIX }}/liblouis.zip
#
# - name: Upload the assets to the snapshot release
# # only upload to snapshot page if it is a push to master in the main repo
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
# uses: shogo82148/actions-upload-release-asset@aac270e08f6b4547ada0b3800f88e1eb3ce9d400 # v1.7.7
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# upload_url: https://uploads.github.com/repos/liblouis/liblouis/releases/8031256/assets{?name,label}
# asset_path: ${{ env.PREFIX }}/liblouis.zip
# asset_name: liblouis-w32.zip
# asset_content_type: application/zip
# overwrite: true