| name: Cross-compile with mingw |
| |
| on: |
| workflow_dispatch: |
| push: |
| branches: [ master ] |
| paths-ignore: |
| - README |
| - NEWS |
| pull_request: |
| branches: [ master ] |
| |
| 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: |
| - uses: actions/checkout@v2 |
| - 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 |
| - 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@v2 |
| 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@v2 |
| 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@v1 |
| 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 |
| |
| build-w32: |
| name: Build for win32 |
| |
| runs-on: ubuntu-latest |
| env: |
| HOST: i686-w64-mingw32 |
| PREFIX: /tmp/build/win32 |
| |
| steps: |
| - uses: actions/checkout@v2 |
| - 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@v2 |
| 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@v2 |
| 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@v1 |
| 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 |