mirror of
https://github.com/anope/anope.git
synced 2026-06-12 17:24:49 +02:00
Sync the CI scripts.
This commit is contained in:
@@ -3,21 +3,18 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 0'
|
- cron: 0 0 * * 0
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: "!contains(github.event.head_commit.message, '[skip alpine ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip alpine ci]')"
|
||||||
container: alpine:edge
|
container: alpine:latest
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
CXX: ${{ matrix.compiler }}
|
|
||||||
CXXFLAGS: -Werror
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |-
|
||||||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
||||||
apk update
|
apk update
|
||||||
apk add \
|
apk add \
|
||||||
@@ -37,24 +34,36 @@ jobs:
|
|||||||
tre-dev
|
tre-dev
|
||||||
|
|
||||||
- name: Enable extras
|
- name: Enable extras
|
||||||
run: |
|
run: |-
|
||||||
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
||||||
do
|
do
|
||||||
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
|
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Run CMake
|
- name: Run CMake
|
||||||
run: |
|
env:
|
||||||
mkdir build && cd build
|
CC: ${{ matrix.compiler.cc }}
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=$(readlink -f ../run) ..
|
CXX: ${{ matrix.compiler.cxx }}
|
||||||
|
CXXFLAGS: -Werror
|
||||||
|
run: |-
|
||||||
|
cmake -B "build" \
|
||||||
|
-D "CMAKE_BUILD_TYPE=Debug" \
|
||||||
|
-D "INSTDIR=$(readlink -f ../run)" \
|
||||||
|
-G "Ninja" \
|
||||||
|
-Wdeprecated \
|
||||||
|
-Wdev
|
||||||
|
|
||||||
- name: Build Anope
|
- name: Build and install
|
||||||
run: |
|
env:
|
||||||
ninja -C build install
|
VERBOSE: ${{ runner.debug }}
|
||||||
|
run: |-
|
||||||
|
ninja -C "build" ${{ runner.debug == '1' && '-v' || '' }} install
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
compiler:
|
compiler:
|
||||||
- clang++
|
- cc: clang
|
||||||
- g++
|
cxx: clang++
|
||||||
|
- cc: gcc
|
||||||
|
cxx: g++
|
||||||
|
|||||||
@@ -3,20 +3,17 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 0'
|
- cron: 0 0 * * 0
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ubuntu ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip ubuntu ci]')"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
CXX: ${{ matrix.compiler }}
|
|
||||||
CXXFLAGS: -Werror
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |-
|
||||||
sudo apt-get update --assume-yes
|
sudo apt-get update --assume-yes
|
||||||
sudo apt-get install --assume-yes --no-install-recommends \
|
sudo apt-get install --assume-yes --no-install-recommends \
|
||||||
clang \
|
clang \
|
||||||
@@ -34,24 +31,36 @@ jobs:
|
|||||||
ninja-build
|
ninja-build
|
||||||
|
|
||||||
- name: Enable extras
|
- name: Enable extras
|
||||||
run: |
|
run: |-
|
||||||
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
||||||
do
|
do
|
||||||
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
|
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Run CMake
|
- name: Run CMake
|
||||||
run: |
|
env:
|
||||||
mkdir build && cd build
|
CC: ${{ matrix.compiler.cc }}
|
||||||
cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=DEBUG -DINSTDIR:STRING=${{ github.workspace }}/run ..
|
CXX: ${{ matrix.compiler.cxx }}
|
||||||
|
CXXFLAGS: -Werror
|
||||||
|
run: |-
|
||||||
|
cmake -B "build" \
|
||||||
|
-D "CMAKE_BUILD_TYPE=Debug" \
|
||||||
|
-D "INSTDIR=${{ github.workspace }}/run" \
|
||||||
|
-G "Ninja" \
|
||||||
|
-Wdeprecated \
|
||||||
|
-Wdev
|
||||||
|
|
||||||
- name: Build Anope
|
- name: Build and install
|
||||||
run: |
|
env:
|
||||||
ninja -C ${{ github.workspace }}/build install
|
VERBOSE: ${{ runner.debug }}
|
||||||
|
run: |-
|
||||||
|
ninja -C "build" ${{ runner.debug == '1' && '-v' || '' }} install
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
compiler:
|
compiler:
|
||||||
- clang++
|
- cc: clang
|
||||||
- g++
|
cxx: clang++
|
||||||
|
- cc: gcc
|
||||||
|
cxx: g++
|
||||||
|
|||||||
@@ -6,77 +6,90 @@ on:
|
|||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 0'
|
- cron: 0 0 * * 0
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
|
||||||
runs-on: windows-2025
|
runs-on: windows-2025
|
||||||
env:
|
env:
|
||||||
|
BUILD_PATH: ${{ github.workspace }}\build
|
||||||
BUILD_TYPE: ${{ github.event_name == 'release' && 'Release' || 'Debug' }}
|
BUILD_TYPE: ${{ github.event_name == 'release' && 'Release' || 'Debug' }}
|
||||||
|
CONAN_FILE: ${{ github.workspace }}\src\win32\conanfile.txt
|
||||||
CONAN_HOME: ${{ github.workspace }}\build\conan
|
CONAN_HOME: ${{ github.workspace }}\build\conan
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install NSIS
|
- name: Setup MSVC
|
||||||
|
uses: TheMrMilchmann/setup-msvc-dev@v4
|
||||||
|
with:
|
||||||
|
arch: x64
|
||||||
|
|
||||||
|
- name: Setup NSIS
|
||||||
uses: negrutiu/nsis-install@v3
|
uses: negrutiu/nsis-install@v3
|
||||||
with:
|
with:
|
||||||
distro: official
|
distro: official
|
||||||
|
|
||||||
- name: Setup MSBuild
|
|
||||||
uses: microsoft/setup-msbuild@v3
|
|
||||||
|
|
||||||
- name: Setup Conan
|
- name: Setup Conan
|
||||||
uses: turtlebrowser/get-conan@v1.2
|
uses: turtlebrowser/get-conan@v1.2
|
||||||
|
|
||||||
- name: Create Conan profile
|
- name: Create Conan configuration
|
||||||
run: |-
|
run: |-
|
||||||
conan profile detect
|
conan profile detect
|
||||||
(Get-Content ${{ env.CONAN_HOME }}\profiles\default).replace('build_type=Release', 'build_type=${{ env.BUILD_TYPE }}') | Set-Content ${{ env.CONAN_HOME }}\profiles\default
|
(Get-Content ${{ env.CONAN_HOME }}\profiles\default).replace('build_type=Release', 'build_type=${{ env.BUILD_TYPE }}') | Set-Content ${{ env.CONAN_HOME }}\profiles\default
|
||||||
(Get-Content ${{ env.CONAN_HOME }}\profiles\default).replace('compiler.cppstd=14', 'compiler.cppstd=17') | Set-Content ${{ env.CONAN_HOME }}\profiles\default
|
(Get-Content ${{ env.CONAN_HOME }}\profiles\default).replace('compiler.cppstd=14', 'compiler.cppstd=17') | Set-Content ${{ env.CONAN_HOME }}\profiles\default
|
||||||
|
|
||||||
Write-Output 'core.sources:download_urls=["origin", "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/"]' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
|
Write-Output 'core.sources:download_urls=["origin", "https://c3i.jfrog.io/artifactory/conan-center-backup-sources/"]' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
|
||||||
|
Write-Output 'tools.cmake.cmaketoolchain:generator=Ninja' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
|
||||||
|
Write-Output 'user.openssl:windows_use_jom=True' | Out-File -Append ${{ env.CONAN_HOME }}\global.conf
|
||||||
|
|
||||||
- name: Try to restore libraries from the cache
|
- name: Try to restore libraries from the cache
|
||||||
|
if: github.event_name != 'release'
|
||||||
uses: actions/cache/restore@v5
|
uses: actions/cache/restore@v5
|
||||||
id: library-cache
|
id: library-cache
|
||||||
with:
|
with:
|
||||||
key: conan-${{ env.BUILD_TYPE }}-${{ hashFiles('src\win32\conanfile.txt') }}
|
key: Conan VS${{ env.VisualStudioVersion }} ${{ env.BUILD_TYPE }} ${{ hashFiles(env.CONAN_FILE) }}
|
||||||
path: ${{ env.CONAN_HOME }}\p
|
path: ${{ env.CONAN_HOME }}/p
|
||||||
|
|
||||||
- name: Install libraries
|
- name: Install libraries
|
||||||
run: |
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
(Get-Content ${{ github.workspace }}\src\win32\conanfile.txt).replace('##', '') | Set-Content ${{ github.workspace }}\src\win32\conanfile.txt
|
run: |-
|
||||||
conan install ${{ github.workspace }}\src\win32 --build missing --deployer runtime_deploy --deployer-folder ${{ github.workspace }}\build\extradll --output-folder .
|
(Get-Content ${{ env.CONAN_FILE }}).replace('##', '') | Set-Content ${{ env.CONAN_FILE }}
|
||||||
|
conan install ${{ env.CONAN_FILE }} --build missing --deployer runtime_deploy --deployer-folder extradll --output-folder .
|
||||||
|
conan cache clean "*"
|
||||||
|
|
||||||
- name: Save libraries to the cache
|
- name: Save libraries to the cache
|
||||||
if: ${{ steps.library-cache.outputs.cache-hit != 'true' }}
|
if: steps.library-cache.outputs.cache-hit != 'true' && github.event_name != 'release'
|
||||||
uses: actions/cache/save@v5
|
uses: actions/cache/save@v5
|
||||||
with:
|
with:
|
||||||
key: ${{ steps.library-cache.outputs.cache-primary-key }}
|
key: ${{ steps.library-cache.outputs.cache-primary-key }}
|
||||||
path: ${{ env.CONAN_HOME }}\p
|
path: ${{ env.CONAN_HOME }}\p
|
||||||
|
|
||||||
- name: Run CMake
|
- name: Run CMake
|
||||||
shell: cmd # work around a conan-io/conan-center-index bug #21823
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
working-directory: ${{ github.workspace }}\build
|
run: |-
|
||||||
run: |
|
cmake -D "CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}" `
|
||||||
call ${{ github.workspace }}\conanbuild.bat
|
-D "CMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake" `
|
||||||
cmake -A x64 -D "CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}" -D CMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -G "Visual Studio 17 2022" ..
|
-G "Ninja Multi-Config" `
|
||||||
|
-S "${{ github.workspace }}" `
|
||||||
|
-Wdeprecated `
|
||||||
|
-Wdev
|
||||||
|
|
||||||
- name: Build Anope
|
- name: Build installer
|
||||||
working-directory: ${{ github.workspace }}\build
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
run: |
|
run: |-
|
||||||
msbuild PACKAGE.vcxproj /M:5 /P:Configuration=${{ env.BUILD_TYPE }} /P:Platform=x64 /VERBOSITY:MINIMAL
|
ninja -f "build-${{ env.BUILD_TYPE }}.ninja" ${{ runner.debug == '1' && '-v' || '' }} package
|
||||||
|
|
||||||
- name: Upload installer
|
- name: Upload installer
|
||||||
if: "${{ github.event_name == 'release' }}"
|
if: github.event_name == 'release'
|
||||||
working-directory: ${{ github.workspace }}\build
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
gh release upload ${{ github.event.release.tag_name }} $(Get-ChildItem anope-*.exe)
|
gh release upload ${{ github.event.release.tag_name }} $(Get-ChildItem anope-*.exe)
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
if: "${{ github.event_name != 'release' }}"
|
if: github.event_name != 'release'
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: windows-installer
|
name: windows-installer
|
||||||
|
|||||||
Reference in New Issue
Block a user