act-Release -Mac-python #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 2024-12-08 11:40 | |
name: act-Release -Mac-python | |
on: | |
# push | |
workflow_dispatch: | |
inputs: | |
# sprintf: | |
# description: 'sprintf' | |
# type: boolean | |
# default: false | |
PLUGINS_EXTRA: | |
description: 'PLUGINS_EXTRA' | |
type: boolean | |
default: true | |
remove_extra_lng: | |
description: 'remove_extra_lng' | |
type: boolean | |
default: false | |
make_archive_all: | |
description: 'Archive ALL' | |
type: boolean | |
default: false | |
run_tests: | |
# Execute tests defined by the CMake configuration. | |
description: 'run tests' | |
type: boolean | |
default: false | |
MULTIARC_PDF: | |
description: MULTIARC_PDF | |
type: boolean | |
default: false | |
required: true | |
MULTIARC_PDF_PARAMS: | |
description: MULTIARC_PDF_PARAMS | |
default: "multiarc/src/ArcPlg.cpp" | |
required: true | |
SED_STUFF: | |
description: SED_STUFF | |
type: boolean | |
default: true | |
required: true | |
SED_STUFF_PARAMS: | |
description: SED_STUFF_PARAMS | |
default: "filename_to_cat" | |
required: true | |
DEBUG_MODE_1: | |
description: DEBUG_MODE_1 | |
default: "N" | |
required: true | |
DEBUG_MODE_2: | |
description: DEBUG_MODE_2 | |
default: "N" | |
required: true | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
PROG_NAME: far2l | |
PROG_VERSION: "v1.0.0" | |
jobs: | |
build: | |
name: ${{ matrix.job.name }} (${{ matrix.job.os }}) | |
runs-on: ${{ matrix.job.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
#- { name: "minimal" , os: ubuntu-20.04 , dependencies: "-minimal" , options: "" } | |
#- { name: "withWX" , os: ubuntu-20.04 , dependencies: "-smb-nfs-neon", options: "-DUSEWX=yes" } | |
#- { name: "noWX" , os: ubuntu-20.04 , dependencies: "-smb-nfs-neon", options: "-DUSEWX=no" } | |
#- { name: "withPYTHON" , os: ubuntu-20.04 , dependencies: "-smb-nfs-neon", options: "-DPYTHON=yes" } | |
#- { name: "minimal" , os: ubuntu-latest, dependencies: "-minimal" , options: "" } | |
#- { name: "withWX" , os: ubuntu-latest, dependencies: "-smb-nfs-neon", options: "-DUSEWX=yes" } | |
#- { name: "noWX" , os: ubuntu-latest, dependencies: "-smb-nfs-neon", options: "-DUSEWX=no" } | |
#- { name: "withPYTHON" , os: ubuntu-latest, dependencies: "-smb-nfs-neon", options: "-DPYTHON=yes" } | |
- { name: "macos14" , os: macos-14 , dependencies: "-smb-nfs-neon", options: "-DPYTHON=yes" } | |
# - { name: "minimal" , os: macos-12 , dependencies: "-minimal" , options: "" } | |
# - { name: "withWX" , os: macos-12 , dependencies: "-smb-nfs-neon", options: "-DUSEWX=yes" } | |
# - { name: "noWX" , os: macos-12 , dependencies: "-smb-nfs-neon", options: "-DUSEWX=no" } | |
#- { name: "withPYTHON" , os: macos-12 , dependencies: "-smb-nfs-neon", options: "-DPYTHON=yes" } | |
#if: ${{ matrix.job.name }} != 'withPYTHON' || ${{ inputs.withPYTHON }} | |
steps: | |
- name: Checkout | |
uses: deep-soft/checkout@v4 | |
- name: patch CMakeLists.txt | |
continue-on-error: true | |
shell: bash | |
run: | | |
echo "before:"; | |
grep "CMAKE_BUILD_WITH_INSTALL_RPATH" CMakeLists.txt || true; | |
git apply bins/cmake-rpath.diff || true; | |
echo "after:" || true; | |
grep CMAKE_BUILD_WITH_INSTALL_RPATH CMakeLists.txt || true; | |
- name: get os version | |
shell: bash | |
run: | | |
set -x | |
if [[ ${{ matrix.job.os }} =~ "macos" ]]; then | |
_os_name_="macos"; | |
_os_version_=$(sw_vers | grep ProductVersion | cut -d':' -f2 | xargs echo -n); | |
echo "OS_VERSION=$_os_name_-$_os_version_" >> $GITHUB_ENV; | |
else | |
_os_release_file_="/etc/os-release" | |
if [ -f $_os_release_file_ ]; then | |
echo "-1-" | |
cat "$_os_release_file_" | |
echo "-2-" | |
_os_name_=$(cat $_os_release_file_ | grep "^ID=" | head -n 1 | awk -F = '{print $2}' | tr -d \") | |
_os_version_=$(cat $_os_release_file_ | grep "^VERSION_ID=" | head -n 1 | awk -F = '{print $2}' | tr -d \") | |
echo "OS_VERSION=$_os_name_-$_os_version_" >> $GITHUB_ENV | |
fi | |
fi | |
- name: print os version | |
shell: bash | |
run: | | |
echo "OS_VERSION=${{ env.OS_VERSION }}" | |
- name: set program version | |
shell: bash | |
run: | | |
set -x | |
_version_=$(cat packaging/version) | |
echo "PROG_VERSION=v$_version_" >> $GITHUB_ENV | |
- name: print program version | |
shell: bash | |
run: | | |
echo "PROG_VERSION=${{ env.PROG_VERSION }}" | |
- name: set env.SED_EXE and macOS install gnu-sed | |
#if: ${{ startsWith(matrix.job.os, 'macos') }} | |
shell: bash | |
run: | | |
SED_EXE=$(which sed); | |
echo "SED_EXE=$SED_EXE"; | |
if [[ ${{ matrix.job.os }} =~ "macos" ]]; then | |
# brew install gnu-sed; | |
brew reinstall gnu-sed; | |
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"; | |
SED_EXE=$(which sed); | |
fi | |
echo "SED_EXE=$SED_EXE"; | |
echo "SED_EXE=$SED_EXE" >> $GITHUB_ENV; | |
#ls -la $SED_EXE; | |
#export sed=$SED_EXE | |
#which sed | |
- name: MULTIARC_PDF patch 1 | |
if: ${{ inputs.MULTIARC_PDF }} | |
#continue-on-error: true | |
shell: bash | |
env: | |
DEBUG_MODE_1: ${{ inputs.DEBUG_MODE_1 }} | |
DEBUG_MODE_2: ${{ inputs.DEBUG_MODE_2 }} | |
run: | | |
if [[ -f bins/multiarc-pdf-patch.sh ]]; then | |
bash bins/multiarc-pdf-patch.sh "bins/sed-stuff-multiarc-pdf.txt" "${{ inputs.MULTIARC_PDF_PARAMS }}" | |
fi | |
- name: sed-stuff | |
if: ${{ inputs.SED_STUFF }} | |
continue-on-error: true | |
shell: bash | |
env: | |
DEBUG_MODE_1: ${{ inputs.DEBUG_MODE_1 }} | |
DEBUG_MODE_2: ${{ inputs.DEBUG_MODE_2 }} | |
run: | | |
bash bins/sed-stuff.sh "_" "${{ inputs.SED_STUFF_PARAMS }}" | |
- name: extra plugins | |
if: ${{ inputs.PLUGINS_EXTRA }} | |
shell: bash | |
run: | | |
if [[ ${{ matrix.job.name }} != "minimal" ]]; then | |
if [[ ${{ matrix.job.os }} =~ "macos" ]]; then | |
# extra_plugin_list1='netcfgplugin sqlplugin'; | |
extra_plugin_list1=''; | |
extra_plugin_list2='SimpleComment EditWrap'; | |
else | |
# extra_plugin_list1='netcfgplugin sqlplugin processes'; | |
extra_plugin_list1='netcfgplugin processes'; | |
extra_plugin_list2='SimpleComment EditWrap jumpword'; | |
fi | |
if [[ ${{ matrix.job.os }} =~ "macos-13" ]]; then | |
# extra_plugin_list1='sqlplugin'; | |
extra_plugin_list1=''; | |
extra_plugin_list2='SimpleComment EditWrap'; | |
fi | |
# add new extra plugins | |
for plug1 in $extra_plugin_list1 ; do | |
echo "ExtraPluginS=$plug1"; | |
git clone --depth 1 https://github.com/deep-soft/far2l-$plug1.git && \ | |
( echo "mv far2l-$plug1 $plug1" && \ | |
mv far2l-$plug1 $plug1 && \ | |
cd $plug1 && \ | |
find . -mindepth 1 -name 'src' -prune -o -exec rm -rf {} + && \ | |
mv src/* . && rm -rf src ) | |
echo "add_subdirectory($plug1)" >> CMakeLists.txt; | |
echo "ExtraPluginF=$plug1"; | |
done | |
for plug2 in $extra_plugin_list2 ; do | |
echo "ExtraPluginS=$plug2"; | |
git clone --depth 1 https://github.com/deep-soft/far2l-$plug2.git && \ | |
( echo "mv far2l-$plug2 $plug2" && \ | |
mv far2l-$plug2 $plug2 ) | |
echo "add_subdirectory($plug2)" >> CMakeLists.txt | |
echo "ExtraPluginF=$plug2"; | |
done | |
grep "add_subdirectory" CMakeLists.txt | |
fi | |
- name: add dependencies | |
shell: bash | |
run: | | |
cp dependencies.txt dependencies-smb-nfs-neon.txt | |
echo "" >> dependencies-smb-nfs-neon.txt | |
echo "libsmbclient-dev" >> dependencies-smb-nfs-neon.txt | |
echo "libnfs-dev" >> dependencies-smb-nfs-neon.txt | |
echo "libneon27-dev" >> dependencies-smb-nfs-neon.txt | |
# echo "libneon*-dev" >> dependencies-smb-nfs-neon.txt | |
- name: Dependencies | |
continue-on-error: true | |
run: | | |
if [[ ${{ matrix.job.os }} =~ "ubuntu" ]]; then | |
sudo apt-get update ; sudo apt-get -y install $(cat dependencies${{ matrix.job.dependencies }}.txt) | |
fi | |
if [[ ${{ matrix.job.os }} =~ "macos-13" ]]; then | |
#brew bundle -v | |
#export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix)/opt/openssl/lib/pkgconfig:$(brew --prefix)/opt/libarchive/lib/pkgconfig" | |
#echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
# brew reinstall libxau tree | |
# ls /opt/homebrew/Cellar/libxau/1.0.11/lib/libXau* || true; | |
# brew reinstall libxau tree uchardet xml2 wxwidgets libxi samba libnfs neon libssh libarchive pcre | |
brew install libxau tree uchardet xml2 wxwidgets libxi libnfs neon samba libssh libarchive pcre | |
brew reinstall libxau tree | |
# Relink 'keg-only' packages | |
brew link libarchive --force | |
brew link libxau --force | |
brew unlink libxau && brew link libxau | |
ls /usr/local/Cellar/libxau/*/lib/libXau* || true; | |
fi | |
if [[ ${{ matrix.job.os }} =~ "macos-14" ]]; then | |
brew install uchardet libxml2 wxwidgets libxi samba libnfs neon libssh libarchive | |
fi | |
- name: Relink 'keg-only' packages | |
run: | | |
if [[ ${{ matrix.job.os }} =~ "macos-14" ]]; then | |
brew link libarchive --force || true; | |
brew link icu4c --force || true; | |
brew reinstall icu4c@76 || true; | |
fi | |
- name: fix macos libsmbclient.inst.dylib | |
run: | | |
if [[ ${{ matrix.job.os }} =~ "macos" ]]; then | |
mkdir -p /opt/homebrew/opt/samba/lib/ | |
cp /opt/homebrew/lib/libsmbclient.dylib /opt/homebrew/opt/samba/lib/libsmbclient.inst.dylib | |
ls -la /opt/homebrew/lib/libsmbclient.dylib | |
ls -la /opt/homebrew/opt/samba/lib/libsmbclient.inst.dylib | |
fi | |
- name: Create Build Environment | |
# Some projects don't allow in-source building, so create a separate build directory | |
# We'll use this as our working directory for all subsequent commands | |
# Create a separate build directory as working directory for all subsequent commands | |
# cmake -E make_directory ${{github.workspace}}/_build | |
run: | | |
mkdir -p _build | |
- name: Configure CMake | |
# Use a bash shell so we can use the same syntax for environment variable | |
# access regardless of the host operating system | |
shell: bash | |
# working-directory: ${{github.workspace}}/build | |
# Note the current convention is to use the -S and -B options here to specify source | |
# and build directories, but this is only available with CMake 3.13 and higher. | |
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | |
run: | | |
if [[ ${{ matrix.job.os }} =~ "ubuntu" ]]; then | |
# cmake $GITHUB_WORKSPACE -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=$BUILD_TYPE ${{ matrix.job.options }} | |
cmake -S . -B _build -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=$BUILD_TYPE ${{ matrix.job.options }} | |
fi | |
if [[ ${{ matrix.job.os }} =~ "macos-14" ]]; then | |
cmake -S . -B _build -Wno-dev -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPYTHON=yes | |
fi | |
- name: Build | |
working-directory: ${{github.workspace}}/_build | |
shell: bash | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: | | |
cmake --build . --config $BUILD_TYPE | |
- name: Remove extra languages | |
if: ${{ inputs.remove_extra_lng }} | |
continue-on-error: true | |
working-directory: ${{github.workspace}}/_build | |
shell: bash | |
run: | | |
#touch 0-all-lng-hlf.txt | |
#find . *.lng >> 0-all-lng-hlf.txt | |
#find . *.hlf >> 0-all-lng-hlf.txt | |
#lng_hlf_no_eng=$(grep.exe -i -v "eng\.\|e\.\|en\." 0-all-lng-hlf.txt) | |
lng_hlf_no_eng=$(find . -name *.lng -o -name *.hlf | grep -i -v "eng\.\|en\.\|calce\.|colorere\.") | |
for lng_hlf in $lng_hlf_no_eng ; do | |
echo "$lng_hlf"; | |
rm "$lng_hlf"; | |
done | |
- name: Build package | |
working-directory: ${{github.workspace}}/_build | |
shell: bash | |
run: | | |
cmake --build . --target package | |
if [[ ${{ matrix.job.os }} =~ "macos" ]]; then | |
mv ${{ env.PROG_NAME }}*.dmg ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }}.dmg | |
else | |
mv ${{ env.PROG_NAME }}*.deb ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }}.deb | |
mv ${{ env.PROG_NAME }}*.tar.gz ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }}.tar.gz | |
fi | |
- name: File Tree | |
continue-on-error: true | |
working-directory: ${{github.workspace}}/_build | |
shell: bash | |
run: tree | |
# - name: Packing Artifact | |
# uses: deep-soft/upload-artifact@v3 | |
# with: | |
# name: ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ matrix.job.name }} | |
# path: ${{github.workspace}}/_build/install | |
- name: Archive Release | |
continue-on-error: true | |
uses: deep-soft/zip-release@v2 | |
with: | |
type: 'zip' | |
filename: '${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }}.zip' | |
directory: '${{github.workspace}}/_build/install' | |
path: '.' | |
# exclusions: '*.git* /*node_modules/* .editorconfig' | |
exclusions: '*Bel.lng *Rus.lng *Cze.lng *Ger.lng *Hun.lng *Pol.lng *Spa.lng *Ukr.lng *bel.lng *rus.lng *calcb.lng *calcr.lng *colorerb.lng *colorerr.lng *editorcomp_be.lng *editorcomp_ru.lng *isrcrus.lng' | |
recursive_exclusions: '*Bel.lng *Rus.lng *Cze.lng *Ger.lng *Hun.lng *Pol.lng *Spa.lng *Ukr.lng *bel.lng *rus.lng *calcb.lng *calcr.lng *colorerb.lng *colorerr.lng *editorcomp_be.lng *editorcomp_ru.lng *isrcrus.lng' | |
debug: yes | |
- name: Publish Release | |
continue-on-error: true | |
uses: deep-soft/[email protected] | |
with: | |
draft: true | |
tag_name: ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }} | |
files: | | |
${{ env.ZIP_RELEASE_ARCHIVE }} | |
${{github.workspace}}/_build/${{ env.PROG_NAME }}*.deb | |
${{github.workspace}}/_build/${{ env.PROG_NAME }}*.tar.gz | |
${{github.workspace}}/_build/${{ env.PROG_NAME }}*.dmg | |
- name: Archive Release - All | |
if: ${{ inputs.make_archive_all }} | |
uses: deep-soft/zip-release@v2 | |
with: | |
type: 'zip' | |
filename: '${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }}-ALL.zip' | |
directory: '${{github.workspace}}' | |
path: '.' | |
# exclusions: '*.git* /*node_modules/* .editorconfig' | |
exclusions: '' | |
recursive_exclusions: '' | |
env_variable: ZIP_RELEASE_ARCHIVE_ALL | |
debug: yes | |
- name: Publish Release - All | |
if: ${{ inputs.make_archive_all }} | |
continue-on-error: true | |
uses: deep-soft/[email protected] | |
with: | |
draft: true | |
tag_name: ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-ALL | |
files: | | |
${{ env.ZIP_RELEASE_ARCHIVE_ALL }} | |
- name: Test | |
if: ${{ inputs.run_tests }} | |
working-directory: ${{github.workspace}}/_build | |
shell: bash | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest -C $BUILD_TYPE |