Debian Codegraph @

.github/workflows/mingw.yml

raw symbols SCIP
1 name: Cross-compile with mingw
2
3 on:
4 workflow_dispatch:
5 push:
6 branches: [ master ]
7 paths:
8 - '**.h'
9 - '**.c'
10 - 'liblouis/liblouis/liblouis.h.in'
11 pull_request:
12 branches: [ master ]
13 paths:
14 - '**.h'
15 - '**.c'
16 - 'liblouis/liblouis/liblouis.h.in'
17
18 env:
19 LIBYAML_VERSION: 0.1.4
20
21 jobs:
22 build:
23 name: Build for win64
24
25 runs-on: ubuntu-22.04
26 env:
27 HOST: x86_64-w64-mingw32
28 PREFIX: /tmp/build/win64
29
30 steps:
31 - name: Harden Runner
32 uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
33 with:
34 egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
35
36 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
37 - name: Install dependencies
38 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
39 - name: Build libyaml
40 run: |
41 curl -L https://github.com/yaml/libyaml/archive/${{ env.LIBYAML_VERSION }}.tar.gz | tar zx
42 cd libyaml-${{ env.LIBYAML_VERSION }}
43 patch -p1 < ../libyaml_mingw.patch
44 ./bootstrap
45 ./configure --host ${{ env.HOST }} --prefix=${{ env.PREFIX }}
46 make
47 make install
48 - name: Autogen && configure
49 run: |
50 ./autogen.sh
51 ./configure --host ${{ env.HOST }} --enable-ucs4 --prefix=${{ env.PREFIX }} CPPFLAGS="-I${{ env.PREFIX }}/include/" LDFLAGS="-L${{ env.PREFIX }}/lib/"
52 - name: Make
53 run: make LDFLAGS="-L${{ env.PREFIX }}/lib/ -avoid-version -Xcompiler -static-libgcc"
54 - name: Check
55 run: make check WINE=wine64
56 - name: Store the test suite log
57 if: ${{ failure() }}
58 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
59 with:
60 name: test-suite-w64.log
61 path: tests/test-suite.log
62 - name: Install
63 run: make install
64
65 - name: Zip up the build artifacts
66 run: ( cd ${{ env.PREFIX }}; zip -r liblouis.zip * )
67 - name: Archive the build artifacts
68 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
69 with:
70 name: liblouis-w64.zip
71 path: ${{ env.PREFIX }}/liblouis.zip
72
73 - name: Upload the assets to the snapshot release
74 # only upload to snapshot page if it is a push to master in the main repo
75 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
76 uses: shogo82148/actions-upload-release-asset@394b3c11c3cfc038b5396ad265c074065cf875c3 # v1.10.2
77 with:
78 github_token: ${{ secrets.GITHUB_TOKEN }}
79 upload_url: https://uploads.github.com/repos/liblouis/liblouis/releases/8031256/assets{?name,label}
80 asset_path: ${{ env.PREFIX }}/liblouis.zip
81 asset_name: liblouis-w64.zip
82 asset_content_type: application/zip
83 overwrite: true
84
85 - name: Edit the description of the snapshot release
86 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
87 run: |
88 if ! curl -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
89 -H "Accept: application/json" \
90 -H "Content-type: application/json" \
91 -X PATCH \
92 "https://api.github.com/repos/liblouis/liblouis/releases/8031256" \
93 -d "{\"tag_name\": \"snapshot\", \
94 \"body\": \"Latest build: ${{ github.sha }}\"}" \
95 2>/dev/null \
96 | jq -e '.url'; \
97 then \
98 echo "Failed to edit release description" && \
99 exit 1; \
100 fi
101
102 # win32 build disabled for now: see https://github.com/liblouis/liblouis/issues/1135
103
104 #build-w32:
105 # name: Build for win32
106 #
107 # runs-on: ubuntu-latest
108 # env:
109 # HOST: i686-w64-mingw32
110 # PREFIX: /tmp/build/win32
111 #
112 # steps:
113 # - name: Harden Runner
114 # uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
115 # with:
116 # egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
117 #
118 # - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
119 # - name: Install dependencies
120 # run: sudo apt-get update -qq && sudo apt-get install -y autoconf automake curl libtool make pkg-config texinfo zip patch
121 # - name: Install wine for 32-bit architecture
122 # run: |
123 # sudo apt-get update -qq
124 # sudo dpkg --add-architecture i386
125 # sudo apt-get update
126 # 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
127 #
128 # - name: Build libyaml
129 # run: |
130 # curl -L https://github.com/yaml/libyaml/archive/${{ env.LIBYAML_VERSION }}.tar.gz | tar zx
131 # cd libyaml-${{ env.LIBYAML_VERSION }}
132 # patch -p1 < ../libyaml_mingw.patch
133 # ./bootstrap
134 # ./configure --host ${{ env.HOST }} --prefix=${{ env.PREFIX }}
135 # make
136 # make install
137 # - name: Autogen && configure
138 # run: |
139 # ./autogen.sh
140 # ./configure --host ${{ env.HOST }} --enable-ucs4 --prefix=${{ env.PREFIX }} CFLAGS="-O0" CPPFLAGS="-I${{ env.PREFIX }}/include/" LDFLAGS="-L${{ env.PREFIX }}/lib/"
141 # - name: Make
142 # run: make LDFLAGS="-L${{ env.PREFIX }}/lib/ -avoid-version -Xcompiler -static-libgcc"
143 # - name: Check
144 # run: make check WINE=wine
145 # - name: Store the test suite log
146 # if: ${{ failure() }}
147 # uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
148 # with:
149 # name: test-suite-w32.log
150 # path: tests/test-suite.log
151 # - name: Install
152 # run: make install
153 #
154 # - name: Zip up the build artifacts
155 # run: ( cd ${{ env.PREFIX }}; zip -r liblouis.zip * )
156 # - name: Archive the build artifacts
157 # uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
158 # with:
159 # name: liblouis-w32.zip
160 # path: ${{ env.PREFIX }}/liblouis.zip
161 #
162 # - name: Upload the assets to the snapshot release
163 # # only upload to snapshot page if it is a push to master in the main repo
164 # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
165 # uses: shogo82148/actions-upload-release-asset@394b3c11c3cfc038b5396ad265c074065cf875c3 # v1.10.2
166 # with:
167 # github_token: ${{ secrets.GITHUB_TOKEN }}
168 # upload_url: https://uploads.github.com/repos/liblouis/liblouis/releases/8031256/assets{?name,label}
169 # asset_path: ${{ env.PREFIX }}/liblouis.zip
170 # asset_name: liblouis-w32.zip
171 # asset_content_type: application/zip
172 # overwrite: true