bump rev #257
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
| name: Build | |
| on: [push, pull_request] | |
| jobs: | |
| param: | |
| name: Determine parameter | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - id: param | |
| run: | | |
| python3 <<EOF >"$GITHUB_OUTPUT" | |
| import json | |
| all_branch = ['16', '15', '14', '13'] | |
| common_profile = [ | |
| '64-mcf', '64-win32', '64-ucrt', '64-msvcrt', | |
| '32-mcf', '32-win32', '32-ucrt', '32-msvcrt', | |
| # profile variants for micro architectures | |
| '64_v2-mcf', '64_v2-win32', '64_v2-ucrt', '64_v2-msvcrt', | |
| ] | |
| all_old_profile = [ | |
| '32-msvcrt_win2000', | |
| '32_686-msvcrt_win98', | |
| '32_486-msvcrt_win98', | |
| '32_386-msvcrt_win95', | |
| ] | |
| release_old_profile = [ | |
| '32-msvcrt_win2000', | |
| '32_686-msvcrt_win98', | |
| '32_486-msvcrt_win98', | |
| ] | |
| exclude_profile_branch = [ | |
| {'profile': '32-msvcrt_win2000', 'branch': '16'}, | |
| ] | |
| wsl_branch = ['15'] | |
| wsl_profile = ['64-mcf', '64-ucrt'] | |
| sat_group = [ | |
| { | |
| 'name': '64-stable', | |
| 'profile': json.dumps(['64-mcf', '64-win32', '64-ucrt', '64-msvcrt']), | |
| 'pattern': '{mingw64-mcf-*,mingw64-win32-*,mingw64-ucrt-*,mingw64-msvcrt-*}', | |
| 'enable_shared': True, | |
| 'dict': '512m', | |
| }, | |
| { | |
| 'name': '64_v2-stable', | |
| 'profile': json.dumps(['64_v2-mcf', '64_v2-win32', '64_v2-ucrt', '64_v2-msvcrt']), | |
| 'pattern': '{mingw64_v2-mcf-*,mingw64_v2-win32-*,mingw64_v2-ucrt-*,mingw64_v2-msvcrt-*}', | |
| 'enable_shared': True, | |
| 'dict': '512m', | |
| }, | |
| { | |
| 'name': '32-stable', | |
| 'profile': json.dumps(['32-mcf', '32-win32', '32-ucrt', '32-msvcrt']), | |
| 'pattern': '{mingw32-mcf-*,mingw32-win32-*,mingw32-ucrt-*,mingw32-msvcrt-*}', | |
| 'enable_shared': True, | |
| 'dict': '512m', | |
| }, | |
| { | |
| 'name': '32-unstable', | |
| 'profile': json.dumps(['32-msvcrt_win2000']), | |
| 'pattern': 'mingw32-msvcrt_win2000-*', | |
| 'enable_shared': False, | |
| 'dict': '128m', | |
| }, | |
| { | |
| 'name': '32_686-unstable', | |
| 'profile': json.dumps(['32_686-msvcrt_win98']), | |
| 'pattern': 'mingw32_686-*', | |
| 'enable_shared': False, | |
| 'dict': '128m', | |
| }, | |
| { | |
| 'name': '32_486-unstable', | |
| 'profile': json.dumps(['32_486-msvcrt_win98']), | |
| 'pattern': 'mingw32_486-*', | |
| 'enable_shared': False, | |
| 'dict': '128m', | |
| }, | |
| { | |
| 'name': '32_386-unstable', | |
| 'profile': json.dumps(['32_386-msvcrt_win95']), | |
| 'pattern': 'mingw32_386-*', | |
| 'enable_shared': False, | |
| 'dict': '128m', | |
| }, | |
| ] | |
| sat_exclude_profile_branch = ':'.join([ | |
| f'{x['profile']}-{x['branch']}' | |
| for x in exclude_profile_branch | |
| ]) | |
| if '${{ github.ref_type }}' == 'tag': | |
| current_branch = '${{ github.ref_name }}'.split('-')[0].split('.')[0] | |
| branch = [current_branch] | |
| profile = [ | |
| p for p in (common_profile + release_old_profile) | |
| if not any( | |
| p == x['profile'] and branch == x['branch'] | |
| for x in exclude_profile_branch)] | |
| execlude_profile_branch = [] | |
| release = True | |
| prerelease = int(current_branch) >= 16 | |
| else: | |
| branch = all_branch | |
| profile = common_profile + all_old_profile | |
| release = False | |
| prerelease = True | |
| print(f'branch={json.dumps(branch)}') | |
| print(f'profile={json.dumps(profile)}') | |
| print(f'exclude_profile_branch={json.dumps(exclude_profile_branch)}') | |
| print(f'shared_profile={json.dumps(common_profile)}') | |
| print(f'wsl_branch={json.dumps(wsl_branch)}') | |
| print(f'wsl_profile={json.dumps(wsl_profile)}') | |
| print(f'release={json.dumps(release)}') | |
| print(f'prerelease={json.dumps(prerelease)}') | |
| print(f'sat_group={json.dumps(sat_group)}') | |
| print(f'sat_exclude_profile_branch={sat_exclude_profile_branch}') | |
| EOF | |
| outputs: | |
| branch: ${{ steps.param.outputs.branch }} | |
| profile: ${{ steps.param.outputs.profile }} | |
| exclude_profile_branch: ${{ steps.param.outputs.exclude_profile_branch }} | |
| shared_profile: ${{ steps.param.outputs.shared_profile }} | |
| wsl_branch: ${{ steps.param.outputs.wsl_branch }} | |
| wsl_profile: ${{ steps.param.outputs.wsl_profile }} | |
| release: ${{ steps.param.outputs.release }} | |
| prerelease: ${{ steps.param.outputs.prerelease }} | |
| sat_group: ${{ steps.param.outputs.sat_group }} | |
| sat_exclude_profile_branch: ${{ steps.param.outputs.sat_exclude_profile_branch }} | |
| download_source: | |
| name: Download source | |
| runs-on: ubuntu-24.04 | |
| needs: param | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| branch: ${{ fromJson(needs.param.outputs.branch) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download source | |
| run: | | |
| ./main.py --branch ${{ matrix.branch }} --profile 64-mcf --download-only | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: src-${{ matrix.branch }} | |
| path: | | |
| assets | |
| build_container: | |
| name: Build container | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build container | |
| run: | | |
| podman build -t mingw-lite/buildenv support/buildenv | |
| mkdir assets | |
| podman save mingw-lite/buildenv:latest | zstd -o assets/buildenv.tar.zst | |
| - name: Upload container | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: buildenv | |
| path: assets/buildenv.tar.zst | |
| build: | |
| name: Build | |
| needs: [param, download_source, build_container] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: ${{ fromJson(needs.param.outputs.branch) }} | |
| profile: ${{ fromJson(needs.param.outputs.profile) }} | |
| exclude: ${{ fromJson(needs.param.outputs.exclude_profile_branch) }} | |
| uses: ./.github/workflows/build_single.yml | |
| with: | |
| branch: ${{ matrix.branch }} | |
| profile: ${{ matrix.profile }} | |
| enable_shared: ${{ contains(fromJson(needs.param.outputs.shared_profile), matrix.profile) }} | |
| wsl_build_container: | |
| name: Build container (WSL) | |
| needs: [param] | |
| if: ${{ ! fromJson(needs.param.outputs.release) }} | |
| runs-on: windows-2025 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build container (WSL) | |
| run: | | |
| Copy-Item -Path support/wsl/.wslconfig -Destination "$env:USERPROFILE/.wslconfig" | |
| Invoke-WebRequest ` | |
| -Uri https://cdimages.ubuntu.com/ubuntu-wsl/noble/daily-live/current/noble-wsl-amd64.wsl ` | |
| -OutFile noble-wsl-amd64.wsl | |
| wsl --import mingw-lite-buildenv . noble-wsl-amd64.wsl | |
| wsl --distribution mingw-lite-buildenv --exec ` | |
| apt update | |
| wsl --distribution mingw-lite-buildenv --exec ` | |
| env DEBIAN_FRONTEND=noninteractive ` | |
| apt-get install --no-install-recommends -y ` | |
| autoconf automake build-essential cmake flex gettext libtool meson texinfo xmake ` | |
| 7zip ca-certificates curl file gawk libarchive-tools python3 python3-packaging zstd | |
| wsl --distribution mingw-lite-buildenv --exec ` | |
| sync | |
| wsl --shutdown | |
| mkdir assets | |
| wsl --export mingw-lite-buildenv - | zstd -9 -o assets/buildenv.tar.zst | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wsl-buildenv | |
| path: assets/buildenv.tar.zst | |
| wsl_build: | |
| name: Build (WSL) | |
| needs: [param, download_source, wsl_build_container] | |
| if: ${{ ! fromJson(needs.param.outputs.release) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: ${{ fromJson(needs.param.outputs.wsl_branch) }} | |
| profile: ${{ fromJson(needs.param.outputs.wsl_profile) }} | |
| uses: ./.github/workflows/wsl_build_single.yml | |
| with: | |
| branch: ${{ matrix.branch }} | |
| profile: ${{ matrix.profile }} | |
| enable_shared: ${{ contains(fromJson(needs.param.outputs.shared_profile), matrix.profile) }} | |
| release: | |
| name: Release | |
| needs: [param, build] | |
| if: ${{ fromJson(needs.param.outputs.release) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| branch: ${{ fromJson(needs.param.outputs.branch) }} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: ConorMacBride/install-package@v1 | |
| with: | |
| apt: 7zip jq libarchive-tools | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: mingw* | |
| path: dist | |
| merge-multiple: true | |
| - name: 7z archive | |
| run: | | |
| cd dist | |
| jobs=$(nproc) | |
| mingw_list=( | |
| $(echo '${{ needs.param.outputs.profile }}' | jq -r '.[]') | |
| ) | |
| for pn in ${mingw_list[@]} ; do | |
| { | |
| dn=mingw$pn-${{ matrix.branch }} | |
| fn=$(ls mingw$pn-*.tar.zst) | |
| bn=$(basename $fn .tar.zst) | |
| bsdtar -xf $fn | |
| 7z a -t7z -mx9 -ms=on -m0=LZMA:d=64m:fb64 $bn.7z $dn | |
| rm -rf $dn | |
| } & | |
| while [[ $(jobs -r -p | wc -l) -ge $jobs ]] ; do | |
| sleep 1 | |
| done | |
| done | |
| wait | |
| for pn in ${mingw_list[@]} ; do | |
| { | |
| dn=mingw$pn-${{ matrix.branch }} | |
| fn=$(ls xmake-mingw$pn-*.tar.zst) | |
| bn=$(basename $fn .tar.zst) | |
| bsdtar -xf $fn | |
| 7z a -t7z -mx9 -ms=on -m0=LZMA:d=64m:fb64 $bn.7z $dn | |
| rm -rf $dn | |
| } & | |
| while [[ $(jobs -r -p | wc -l) -ge $jobs ]] ; do | |
| sleep 1 | |
| done | |
| done | |
| wait | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: ${{ needs.param.outputs.prerelease }} | |
| make_latest: 'false' | |
| files: | | |
| dist/mingw*.tar.zst | |
| dist/mingw*.7z | |
| dist/x-mingw*.tar.zst | |
| dist/xmake-mingw*.7z | |
| sat_archive: | |
| name: Semi-automated testing archive | |
| if: ${{ ! fromJson(needs.param.outputs.release) }} | |
| runs-on: ubuntu-24.04 | |
| needs: [param, build_container, build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJson(needs.param.outputs.sat_group) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ConorMacBride/install-package@v1 | |
| with: | |
| apt: jq libarchive-tools | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: buildenv | |
| path: assets | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: ${{ matrix.pattern }} | |
| path: dist | |
| merge-multiple: true | |
| - name: Load container | |
| run: | | |
| zstdcat assets/buildenv.tar.zst | podman load | |
| - name: Create test archive | |
| run: | | |
| branch=( | |
| $(echo '${{ needs.param.outputs.branch }}' | jq -r '.[]') | |
| ) | |
| profile=( | |
| $(echo '${{ matrix.profile }}' | jq -r '.[]') | |
| ) | |
| mkdir layer | |
| mkdir pkg | |
| for p in ${profile[@]} ; do | |
| # filename can differ from branch name when a a new branch is just created | |
| for archive in $(ls dist/x-mingw$p-*.tar.zst) ; do | |
| bsdtar -C layer -xf $archive | |
| done | |
| done | |
| rm dist/x-mingw*.tar.zst | |
| for b in ${branch[@]} ; do | |
| for p in ${profile[@]} ; do | |
| if [[ ":${{ needs.param.outputs.sat_exclude_profile_branch }}:" == *":$p-$b:"* ]] ; then | |
| continue | |
| fi | |
| podman run --rm --cap-add=sys_admin \ | |
| -v $PWD:/mnt -w /mnt \ | |
| -v $PWD/layer:/tmp/layer \ | |
| -v $PWD/pkg:/tmp/pkg \ | |
| mingw-lite/buildenv \ | |
| ./sat.py --branch $b --profile $p ${{ matrix.enable_shared && '--enable-shared' || '' }} | |
| rm -rf layer/mingw$p-$b | |
| done | |
| done | |
| ( | |
| cd pkg | |
| 7z a -t7z -mx9 -ms=on -mqs -m0=LZMA:d=${{ matrix.dict }}:fb64 ../dist/sat${{ matrix.name }}.7z sat* | |
| ) | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sat${{ matrix.name }} | |
| path: dist/sat${{ matrix.name }}.7z |