test-sed-stuff #7
This file contains hidden or 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
| # 2025-11-27 23:30 | |
| name: test-sed-stuff | |
| on: | |
| # push | |
| workflow_dispatch: | |
| inputs: | |
| 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-22.04 , dependencies: "-minimal" , options: "" } | |
| - { name: "minimal" , os: ubuntu-latest , dependencies: "-minimal" , options: "" } | |
| - { name: "minimal" , os: macos-13 , dependencies: "-minimal" , options: "" } | |
| - { name: "minimal" , os: macos-15-intel, dependencies: "-minimal" , options: "" } | |
| - { name: "minimal" , os: macos-latest , dependencies: "-minimal" , options: "" } | |
| #if: ${{ matrix.job.name }} != 'withPYTHON' || ${{ inputs.withPYTHON }} | |
| steps: | |
| - name: Checkout source code | |
| uses: deep-soft/checkout@v4 | |
| - 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: 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: check sed-stuff | |
| if: ${{ inputs.SED_STUFF }} | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| grep "ReplaceStrings" far2l/src/macro/macro.cpp; | |
| - name: macos install tree | |
| shell: bash | |
| run: | | |
| set -x; | |
| if [[ ${{ matrix.job.os }} =~ "macos" ]]; then | |
| brew install tree; | |
| fi | |
| - name: extra scripts | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| if [ -d bins/extra-scripts ]; then | |
| cp bins/extra-scripts/*.sh far2l/bootstrap || true; | |
| cp bins/extra-scripts/*.1 far2l/bootstrap || true; | |
| fi | |
| - name: Prepare for package 1 | |
| continue-on-error: true | |
| working-directory: '${{github.workspace}}' | |
| shell: bash | |
| run: | | |
| mkdir -p _build/install; | |
| cp far2l/bootstrap/*.sh _build/install; | |
| pushd _build/install; | |
| ls -la; | |
| popd; | |
| - name: Prepare for package 2 | |
| continue-on-error: true | |
| working-directory: '${{github.workspace}}/_build/install' | |
| shell: bash | |
| run: | | |
| echo 'Prepare for package'; | |
| echo "Version: " ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }} > 00-info.txt; | |
| if [ -f neofetch.sh ]; then | |
| bash neofetch.sh --stdout >> 00-info.txt; | |
| fi | |
| cat 00-info.txt; | |
| tree; | |
| - name: Upload results | |
| continue-on-error: true | |
| uses: deep-soft/upload-artifact@v4 | |
| with: | |
| name: ${{ env.PROG_NAME }}-${{ env.PROG_VERSION }}-${{ env.OS_VERSION }}-${{ matrix.job.name }} | |
| path: '${{github.workspace}}/_build/install/00-info.txt' |