ci: hardcode release emsdk version, bump emsdk and perl versions used… #260
Workflow file for this run
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
| # GitHub Actions CI script for MHFS | |
| # (C) 2022 Gavin Hayes | |
| name: Build MHFS | |
| on: [ push, pull_request ] | |
| jobs: | |
| build-linux: | |
| name: Build MHFS | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repo and submodules | |
| uses: actions/checkout@v3 | |
| with: | |
| path: 'MHFS' | |
| submodules: 'true' | |
| - name: Install System Prerequisites | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y --no-install-recommends build-essential wget curl libflac-dev | |
| - name: Install Perl and MHFS Perl dependencies | |
| uses: shogo82148/actions-setup-perl@v1 | |
| with: | |
| perl-version: '5.40' | |
| working-directory: MHFS | |
| install-modules-with: cpanm | |
| install-modules-args: --with-develop --with-configure --with-recommends | |
| - name: Setup emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: '4.0.12' | |
| actions-cache-folder: 'emsdk-cache' | |
| - name: Build and package MHFS | |
| run: | | |
| cd MHFS | |
| make release | |
| - name: Archive CPAN logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cpan_log_build_linux | |
| path: /home/runner/.cpanm/work/*/build.log | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MHFS | |
| path: | | |
| MHFS/MHFS_*.tar | |
| build-apperl: | |
| name: Build Binary | |
| needs: [ build-linux ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repo | |
| uses: actions/checkout@v3 | |
| with: | |
| path: 'MHFS' | |
| - name: Install Perl and MHFS Perl dependencies | |
| uses: shogo82148/actions-setup-perl@v1 | |
| with: | |
| perl-version: '5.40' | |
| working-directory: MHFS | |
| install-modules-with: cpanm | |
| install-modules: LWP::UserAgent LWP::Protocol::https Perl::Dist::APPerl | |
| - name: Fetch build artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Setup mhfs apperl deps | |
| run: | | |
| cd MHFS | |
| make apperl/HTML-Template apperl/URI apperl/Class-Inspector apperl/File-ShareDir apperl/File-ShareDir-Install apperl/Module-Build apperl/Feature-Compat-Try | |
| tar xvf MHFS*.tar | |
| rm MHFS*.tar | |
| tar xvf MHFS*/App-MHFS-*.tar.gz | |
| mv App-MHFS-* apperl/App-MHFS | |
| - name: support ape bins | |
| run: sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register" | |
| - name: Configure and Build mhfs.com | |
| env: | |
| CF_BY: ${{ secrets.CF_BY }} | |
| CF_EMAIL: ${{ secrets.CF_EMAIL }} | |
| run: | | |
| cd MHFS/apperl | |
| apperlm checkout mhfs | |
| apperlm list | |
| apperlm configure -Dcf_by="$CF_BY" -Dcf_email="$CF_EMAIL" | |
| apperlm build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MHFS_bin | |
| path: | | |
| MHFS/apperl/mhfs.com | |
| test-emcc: | |
| name: Test building Wasm | |
| strategy: | |
| matrix: | |
| os: ['ubuntu-latest'] | |
| emcc: ['1.40.1', '2.0.34', '3.1.74', '4.0.0', 'latest'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Fetch repo and submodules | |
| uses: actions/checkout@v3 | |
| with: | |
| path: 'MHFS' | |
| submodules: 'true' | |
| - name: Setup emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: ${{ matrix.emcc }} | |
| actions-cache-folder: 'emsdk-cache' | |
| - name: Test building Wasm with emcc ${{ matrix.emcc }} on ${{ matrix.os }} | |
| run: | | |
| cd MHFS | |
| make music_worklet music_inc | |
| test-release: | |
| needs: [ build-linux ] | |
| strategy: | |
| matrix: | |
| os: ['ubuntu-latest'] | |
| perl: [ '5.14', '5.16', '5.18' ] | |
| runs-on: ${{ matrix.os }} | |
| name: Test release with ${{ matrix.perl }} on ${{ matrix.os }} | |
| steps: | |
| - name: Fetch build artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Extract MHFS and rename to unversioned filenames | |
| run: | | |
| mv MHFS/*.tar MHFS.tar | |
| tar -xvf MHFS.tar | |
| rm -r MHFS MHFS.tar | |
| mv MHFS_* MHFS | |
| cd MHFS | |
| mv Alien-Tar-Size*.tar.gz Alien-Tar-Size.tar.gz | |
| mv App-MHFS*.tar.gz App-MHFS.tar.gz | |
| - name: Install System Prerequisites | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y --no-install-recommends build-essential wget curl | |
| - name: Install Perl and MHFS using cpanm | |
| uses: shogo82148/actions-setup-perl@v1 | |
| with: | |
| perl-version: ${{ matrix.perl }} | |
| working-directory: MHFS | |
| install-modules-with: cpanm | |
| install-modules: Alien-Tar-Size.tar.gz App-MHFS.tar.gz | |
| - name: Try loading App::MHFS | |
| run: | | |
| perl -MApp::MHFS -e 'print $App::MHFS::VERSION . "\n";' | |
| - name: Archive CPAN logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cpan_log_test_release | |
| path: /home/runner/.cpanm/work/*/build.log | |
| test-full-release: | |
| needs: [ build-linux ] | |
| strategy: | |
| matrix: | |
| os: ['ubuntu-latest'] | |
| perl: [ '5.20', '5.22', '5.24', '5.26', '5.28', '5.30', '5.32', '5.34', '5.36', '5.38', '5.40', '5' ] | |
| runs-on: ${{ matrix.os }} | |
| name: Test release with ${{ matrix.perl }} on ${{ matrix.os }} | |
| steps: | |
| - name: Fetch build artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Extract MHFS and rename to unversioned filenames | |
| run: | | |
| mv MHFS/*.tar MHFS.tar | |
| tar -xvf MHFS.tar | |
| rm -r MHFS MHFS.tar | |
| mv MHFS_* MHFS | |
| cd MHFS | |
| mv Alien-Tar-Size*.tar.gz Alien-Tar-Size.tar.gz | |
| mv Alien-libFLAC*.tar.gz Alien-libFLAC.tar.gz | |
| mv MHFS-XS*.tar.gz MHFS-XS.tar.gz | |
| mv App-MHFS*.tar.gz App-MHFS.tar.gz | |
| - name: Install System Prerequisites | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y --no-install-recommends build-essential wget curl libflac-dev | |
| - name: Install Perl and MHFS using cpanm | |
| uses: shogo82148/actions-setup-perl@v1 | |
| with: | |
| perl-version: ${{ matrix.perl }} | |
| working-directory: MHFS | |
| install-modules-with: cpanm | |
| install-modules: Alien-Tar-Size.tar.gz Alien-libFLAC.tar.gz MHFS-XS.tar.gz App-MHFS.tar.gz | |
| - name: Try loading App::MHFS | |
| run: | | |
| perl -MApp::MHFS -e 'print $App::MHFS::VERSION . "\n";' | |
| perl -MMHFS::XS -e 'print $MHFS::XS::VERSION . "\n";' | |
| - name: Archive CPAN logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cpan_log_test_full_release | |
| path: /home/runner/.cpanm/work/*/build.log | |
| test-windows-Alien-Tar-Size: | |
| needs: [ build-linux ] | |
| strategy: | |
| matrix: | |
| os: ['windows-latest'] | |
| runs-on: ${{ matrix.os }} | |
| name: Test Alien-Tar-Size with on ${{ matrix.os }} | |
| steps: | |
| - name: Fetch build artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Extract MHFS and rename to unversioned filenames | |
| shell: bash | |
| run: | | |
| mv MHFS/*.tar MHFS.tar | |
| tar -xvf MHFS.tar | |
| rm -r MHFS MHFS.tar | |
| mv MHFS_* MHFS | |
| cd MHFS | |
| mv Alien-Tar-Size*.tar.gz Alien-Tar-Size.tar.gz | |
| tar -xvf Alien-Tar-Size*.tar.gz | |
| rm Alien-Tar-Size*.tar.gz | |
| mv Alien-Tar-Size* Alien-Tar-Size | |
| - name: Install Perl and Alien-Tar-Size configure deps using cpanm | |
| uses: shogo82148/actions-setup-perl@v1 | |
| with: | |
| distribution: strawberry | |
| working-directory: MHFS | |
| install-modules-with: cpanm | |
| install-modules: Alien::Build IPC::Run3 | |
| - name: Verify installing Alien-Tar-Size fails as expected | |
| shell: perl {0} | |
| run: | | |
| use strict; use warnings; | |
| use IPC::Run3; | |
| chdir('MHFS/Alien-Tar-Size') or die('failed to chdir'); | |
| my @cmd = ('perl', 'Makefile.PL'); | |
| my $stderr; | |
| run3(\@cmd, undef, undef, \$stderr) or die('run3 failed'); | |
| ($? != 0) or die('command was supposed to fail'); | |
| index($stderr, 'OS unsupported') != -1 or die("Error does not say OS unsupported"); | |
| print "Success, error says OS unsupported\n"; | |
| - name: Archive CPAN logs | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cpan_log_test_windows_Alien_libFLAC | |
| path: C:\Users\RUNNER*\.cpanm\work\*\build.log | |
| create-release: | |
| name: Create release | |
| runs-on: ubuntu-latest | |
| needs: [ build-linux, build-apperl, 'test-release', test-full-release, test-emcc, test-windows-Alien-Tar-Size ] | |
| steps: | |
| - name: Fetch build artifacts | |
| if: ${{ github.ref_type == 'tag' }} | |
| uses: actions/download-artifact@v4 | |
| - name: Publish release | |
| if: ${{ github.ref_type == 'tag' }} | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| fail_on_unmatched_files: true | |
| draft: true | |
| files: | | |
| MHFS/MHFS_*.tar | |
| MHFS_bin/mhfs.com |