Skip to content

Commit

Permalink
updated win mingw build via appyeyor CI and github action CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chcg committed May 10, 2024
1 parent a0f7775 commit 9000e2d
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set the default behavior to unix line endings, required by perl code
* text eol=lf
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
81 changes: 81 additions & 0 deletions .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI_build

on: [push, pull_request]

jobs:

build_windows_msys2:

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
build_configuration: [Release, Debug]
build_platform: [x86_64, i686]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Make aspell exe
working-directory: .\
run: |
Write-host "${{ matrix.build_platform }}"
Write-host "${{ matrix.build_configuration }}"
$Env:Path = 'C:\msys64\usr\bin' + [IO.Path]::PathSeparator + $Env:Path
if ( $${{ matrix.build_platform == 'i686'}} ) {$Env:MSYSTEM = 'MINGW32'}
if ( $${{ matrix.build_platform == 'i686'}} ) {$Env:Path = 'C:\msys64\mingw32\bin' + [IO.Path]::PathSeparator + $Env:Path}
if ( $${{ matrix.build_platform == 'x86_64'}} ) {$Env:MSYSTEM = 'MINGW64'}
if ( $${{ matrix.build_platform == 'x86_64'}} ) {$Env:Path = 'C:\msys64\mingw64\bin' + [IO.Path]::PathSeparator + $Env:Path}
if ( $${{ matrix.build_configuration == 'Debug'}} ) {$Env:DEBUG = '1'}
bash -lc "pacman --noconfirm -Syuu"
bash -lc "pacman --noconfirm -Syuu"
if ( $${{ matrix.build_platform == 'i686'}} ) {bash -lc "pacman --noconfirm -S mingw-w64-i686-gcc mingw-w64-i686-make"}
if ( $${{ matrix.build_platform == 'x86_64'}} ) {bash -lc "pacman --noconfirm -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make"}
Write-Output "Tools version:"
Write-Output (((gcc --version) | select-object -first 1) + " " + (gcc -dumpmachine))
Write-Output (mingw32-make --version) | select-object -first 1
Write-Output (sh --version) | select-object -first 1
cd auto
perl -I ./ mk-src.pl
cd ../win32
mingw32-make
mingw32-make prefix=./installation install
- name: Archive artifacts for ${{ matrix.build_platform}} / Release
if: matrix.build_configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: aspell_win.${{ matrix.build_platform}}.${{ matrix.build_configuration}}
path: aspell.exe


build_linux:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_platform: ["x86_64", i686]

steps:
- uses: actions/checkout@v4

- name: Prepare generated files
working-directory: ./auto
run: |
perl -I ./ mk-src.pl
- name: Install packages via apt
run: |
sudo apt-get -qq update
sudo apt-get -qq install -y mingw-w64
(for alt in i686-w64-mingw32-g++ i686-w64-mingw32-gcc x86_64-w64-mingw32-g++ x86_64-w64-mingw32-gcc; do sudo update-alternatives --set $alt /usr/bin/$alt-posix; done);
- name: build make mingw
working-directory: ./win32
run: |
export PATH=/usr/bin/${{ matrix.build_platform }}-w64-mingw32-gcc/bin:/usr/bin/${{ matrix.build_platform }}-w64-mingw32-g++/bin:$PATH
${{ matrix.build_platform }}-w64-mingw32-g++ --version
make TARGET=${{ matrix.build_platform }}-w64-mingw32-
make TARGET=${{ matrix.build_platform }}-w64-mingw32- prefix=./installation install
91 changes: 91 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
version: 0.60.8.{build}
image: Visual Studio 2015

environment:
matrix:
- PlatformToolset: mingw-w64

platform:
- x64
- x86

configuration:
- Release
#- Debug

install:
- if "%platform%"=="x64" set archi=amd64
- if "%platform%"=="x64" set platform_input=x64

- if "%platform%"=="x86" set archi=x86
- if "%platform%"=="x86" set platform_input=x86

- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %archi%

- ps: |
if ($env:PLATFORMTOOLSET -match "mingw-w64") {
if($env:PLATFORM_INPUT -match "x86") {
$env:Path += ";C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin"
$env:Path += ";C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\i686-w64-mingw32\lib"
}
if($env:PLATFORM_INPUT -match "x64") {
$env:Path += ";C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin"
$env:Path += ";C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\lib"
}
$env:Path += ";C:\cygwin64\bin"
$env:Path = $env:Path.Replace('C:\Program Files\Git\usr\bin;','')
g++ --version
mingw32-make --version
}
before_build:
- ps: |
Write-Output "Configuration: $env:CONFIGURATION"
Write-Output "Platform: $env:PLATFORM_INPUT"
build_script:
- cd "%APPVEYOR_BUILD_FOLDER%"
- cd auto
- perl mk-src.pl
- cd "%APPVEYOR_BUILD_FOLDER%"\win32
- ps: |
mingw32-make
mingw32-make install
after_build:
- cd "%APPVEYOR_BUILD_FOLDER%"
- ps: |
if ($env:PLATFORMTOOLSET -match "mingw-w64")
{
Push-AppveyorArtifact "c:/aspell/aspell.exe" -FileName "aspell.exe"
Push-AppveyorArtifact "c:/aspell/aspell-15.dll" -FileName "aspell-15.dll"
if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:PLATFORMTOOLSET -eq "mingw-w64" -and $env:CONFIGURATION -eq "Release")
{
$ZipFileName = "aspell_$($env:APPVEYOR_REPO_TAG_NAME)_$env:PLATFORM_INPUT.zip"
md deploy -Force | Out-Null
md deploy\aspell -Force | Out-Null
Copy-Item c:/aspell/*.* deploy\aspell\
7z a $ZipFileName .\deploy\*
Remove-Item deploy\aspell\*.*
}
}
artifacts:
- path: aspell_*.zip
name: releases

deploy:
provider: GitHub
description: ''
auth_token:
secure: TODO
artifact: releases
draft: false
prerelease: false
force_update: true
on:
appveyor_repo_tag: true
PlatformToolset: mingw-w64
configuration: Release
1 change: 1 addition & 0 deletions common/file_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "fstream.hpp"
#include "errors.hpp"
#include "string_list.hpp"
#include "asc_ctype.hpp"

#ifdef USE_FILE_LOCKS
# include <fcntl.h>
Expand Down
1 change: 1 addition & 0 deletions common/lock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define DISTRIBNET_LOCK__HPP

#include <assert.h>
#include <cstddef>

#include "settings.h"

Expand Down
Loading

0 comments on commit 9000e2d

Please sign in to comment.