From: <sba...@us...> - 2023-08-21 17:12:53
|
This is an automated email from the git hooks/post-receive-user script. sbaldovi pushed a commit to branch master in repository fuse. View the commit online: https://sourceforge.net/p/fuse-emulator/fuse/ci/165e303c7e6e245f163567df5ab3758add002911/ commit 165e303c7e6e245f163567df5ab3758add002911 Author: Miroslav Ďurčík <743...@us...> AuthorDate: Tue Jul 25 15:19:51 2023 +0200 CI: TEST-BUILD and Nightly Build GitHub workflows feat: --with-test-build configure parameter. Implemented new configure parameter --with-test-build="<First line\\nSecond line" This enables special messages and popups within the application warning about the purpose of this special build. This should distinguish it from the official build. CI: Test-Build workflow - Implemented new github workflow to build so called Test-Builds and release them as GitHub pre-release. Optionally synced to SourceForge. - Initially only windows win32 (ui) and windows SDL configurations have been implemented. "Test version of Fuse App" can be triggered only manually from Actions tab, provided 3 parameters: Libspectrum's branch, description and if to mark generated release as draft. - Test Build workflow is triggered manually or on pull request - On top of used --with-test-build configure parameter, the M4 FUSE_VERSION constant is changed to TEST-BUILD, thus affecting all "About Fuse" dialogs. - Test releases can be updated, workflow can be executed multiple times for the same branch. CI: Added workflow for nightly build : creates pre-release from current master - Allow manual execution of nightly build + every day at 1 AM automatically - Nightly build should generate release notes (list of recent commits) - Master from fuse (source forge) is merged before doing nightly build https://sourceforge.net/p/arki55-fuse-mod/tickets/13/ --- .github/workflows/build_linux.yml | 2 +- .github/workflows/build_macos.yml | 2 +- .github/workflows/build_wii.yml | 2 +- .github/workflows/build_wii_sub.yml | 1 - .github/workflows/build_windows.yml | 7 +- .github/workflows/build_windows_sub.yml | 171 +++++++++++++++++++++++-- .github/workflows/deploy_build_sub.yml | 119 +++++++++++++++++ .github/workflows/nightly_build.yml | 42 ++++++ .github/workflows/test_release.yml | 145 +++++++++++++++++++++ .github/workflows/test_release_windows_sub.yml | 45 +++++++ configure.ac | 30 ++++- fuse.c | 23 ++++ ui/widget/error.c | 12 +- 13 files changed, 582 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 4cd04b26..eeeea7f4 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -2,7 +2,7 @@ name: Fuse App For Linux run-name: Build Fuse App for Linux / ${{ github.actor }} / # Executed upon each commit pushed, merge commit in PR -on: [push, pull_request] +on: [pull_request] jobs: libspectrum: diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 787071e9..dd613b59 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -2,7 +2,7 @@ name: Fuse App For MacOS run-name: Build Fuse App for MacOS / ${{ github.actor }} / # Executed upon each commit pushed, merge commit in PR -on: [push, pull_request] +on: [pull_request] jobs: libspectrum: diff --git a/.github/workflows/build_wii.yml b/.github/workflows/build_wii.yml index 66d91384..e2917858 100644 --- a/.github/workflows/build_wii.yml +++ b/.github/workflows/build_wii.yml @@ -2,7 +2,7 @@ name: Fuse App For WII run-name: Build Fuse App for WII / ${{ github.actor }} / # Executed upon each commit pushed, merge commit in PR -on: [push, pull_request] +on: [pull_request] jobs: libspectrum: diff --git a/.github/workflows/build_wii_sub.yml b/.github/workflows/build_wii_sub.yml index 7993292c..4a348931 100644 --- a/.github/workflows/build_wii_sub.yml +++ b/.github/workflows/build_wii_sub.yml @@ -58,7 +58,6 @@ jobs: echo "$DEVKITPPC/bin" >> $GITHUB_PATH - name: (2) Install dependencies - if: run: | echo "Installing dependencies .." echo "Using devkitpro/devkitppc image" diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 3a03777b..92e092dd 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -2,7 +2,7 @@ name: Fuse App For Windows run-name: Build Fuse App for Windows / ${{ github.actor }} / # Executed upon each commit pushed, merge commit in PR -on: [push, pull_request] +on: [pull_request] jobs: libspectrum: @@ -24,6 +24,7 @@ jobs: needs: [libspectrum] uses: ./.github/workflows/build_windows_sub.yml with: + key: "win32-ui-default" dependencies: "mingw64-i686-libxml2" configure_params: "--with-win32" verify_ui: "win32" @@ -36,6 +37,7 @@ jobs: needs: [libspectrum] uses: ./.github/workflows/build_windows_sub.yml with: + key: "win32-ui-no-libxml2" dependencies: "" configure_params: "--with-win32 --without-libxml2" verify_ui: "win32" @@ -48,6 +50,7 @@ jobs: needs: [libspectrum] uses: ./.github/workflows/build_windows_sub.yml with: + key: "win32-ui-win32-sound" dependencies: "" configure_params: "--with-win32 --with-audio-driver=win32sound" verify_ui: "win32" @@ -60,6 +63,7 @@ jobs: needs: [libspectrum] uses: ./.github/workflows/build_windows_sub.yml with: + key: "win32-ui-null-sound" dependencies: "" configure_params: "--with-win32 --with-audio-driver=null" verify_ui: "win32" @@ -72,6 +76,7 @@ jobs: needs: [libspectrum] uses: ./.github/workflows/build_windows_sub.yml with: + key: "sdl1-ui-sdl1-sound" dependencies: "mingw64-i686-SDL" configure_params: "--without-win32 --with-sdl --disable-sdl2 --with-audio-driver=sdl" verify_ui: "sdl" diff --git a/.github/workflows/build_windows_sub.yml b/.github/workflows/build_windows_sub.yml index 2b476082..c895f5f2 100644 --- a/.github/workflows/build_windows_sub.yml +++ b/.github/workflows/build_windows_sub.yml @@ -5,6 +5,10 @@ run-name: Build Fuse App for windows / ${{ github.actor }} / on: workflow_call: inputs: + # Name this setup (no spaces please) + key: + type: string + required: true dependencies: type: string required: false @@ -13,6 +17,10 @@ on: type: string required: false default: "" + fuse_version: + type: string + required: false + default: "" verify_ui: type: string required: true @@ -28,6 +36,10 @@ on: type: string required: false default: "" + upload_artifacts: + type: boolean + required: false + default: true jobs: build: @@ -41,6 +53,10 @@ jobs: CPPFLAGS: "-I/usr/local/i686-w64-mingw32/include" LDFLAGS: "-L/usr/local/i686-w64-mingw32/lib" PKG_CONFIG_LIBDIR: "/usr/local/i686-w64-mingw32/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" + + # Small help when copying dlls + CYGWIN_LIBDIR: "/usr/i686-w64-mingw32/sys-root/mingw/bin/" + # In case of SDL SDL_CONFIG: "/usr/i686-w64-mingw32/sys-root/mingw/bin/sdl-config" steps: @@ -73,6 +89,7 @@ jobs: gettext-devel \ libtool \ make \ + zip \ mingw64-i686-bzip2 \ mingw64-i686-gcc-core \ mingw64-i686-gcc-g++ \ @@ -80,7 +97,7 @@ jobs: mingw64-i686-libgpg-error \ mingw64-i686-libpng \ mingw64-i686-win-iconv \ - mingw64-i686-winpthread \ + mingw64-i686-winpthreads \ mingw64-i686-zlib \ mingw64-i686-audiofile \ pkg-config \ @@ -92,7 +109,7 @@ jobs: name: libspectrum-installed-windows-fuse-app path: libspectrum - - name: (5) Install libspectrum from artefact + - name: (4b) Install libspectrum from artefact run: | cd ${GITHUB_WORKSPACE} # Extract (-x) files into /usr/local (cannot work with root /) @@ -101,14 +118,26 @@ jobs: echo "Done" shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - name: (6) Autogen.sh + - name: (5a) Adjust fuse_version + if: ${{ inputs.fuse_version }} + run: | + cd ${GITHUB_WORKSPACE} + file="configure.ac" + replace="${{ inputs.fuse_version }}" + content=`cat $file` + content2=${content//m4_define(\[fuse_version\], \[[0-9].[0-9].[0-9]\])/m4_define(\[fuse_version\], \[$replace\])} + echo "$content2" > $file + shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + + - name: (5b) Autogen.sh run: | cd ${GITHUB_WORKSPACE} echo "Running autogen.sh .." ./autogen.sh shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - name: (7) Configure for Windows + - name: (6) Configure for Windows + id: run-configure run: | cd ${GITHUB_WORKSPACE} echo "Running configure .." @@ -121,7 +150,16 @@ jobs: |& tee ./configure.out shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - name: (8) Verify output from configure + - name: (6b) Check config.log (on failure) + if: failure() && steps.run-configure.outcome != 'success' + run: | + cd ${GITHUB_WORKSPACE} + + echo "Reading config.log file .." + cat config.log + shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + + - name: (6c) Verify output from configure # Most of the tested strings are common for all Windows builds # Only the strings related to UI selection differ run: | @@ -139,14 +177,16 @@ jobs: .github/scripts/in_config.sh "libxml2 support: ${{ inputs.verify_libxml2 }}" .github/scripts/in_config.sh "Selected audio driver: ${{ inputs.verify_audio }}" shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - if: ${{ inputs.verify_other }} + + - name: (6d) Verify optional parameter + if: ${{ inputs.verify_other }} run: | cd ${GITHUB_WORKSPACE} .github/scripts/in_config.sh "${{ inputs.verify_other }}" shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - name: (9) Make + - name: (7) Make run: | cd ${GITHUB_WORKSPACE} @@ -154,14 +194,123 @@ jobs: make shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - name: (10) Install + - name: (8) Copy dependency dlls + id: copy-dlls run: | cd ${GITHUB_WORKSPACE} + echo "Create distrib folder if missing .." + + FUSE_VERSION=`./configure --version | grep -Eo "fuse configure (.+)"` + FUSE_VERSION=${FUSE_VERSION//fuse configure /} + echo "Fuse version: $FUSE_VERSION" + + DEST_DIR="fuse-${FUSE_VERSION}-${{ inputs.verify_ui }}" + echo "Dest dir: $DEST_DIR" + if [[ ! -d "$DEST_DIR" ]]; then + mkdir $DEST_DIR + fi + + echo "Copying mandatory dependency dlls .." + cp ${CYGWIN_LIBDIR}libgcc_s_sjlj-1.dll $DEST_DIR + cp ${CYGWIN_LIBDIR}libwinpthread-1.dll $DEST_DIR + cp ${CYGWIN_LIBDIR}libgpg-error-0.dll $DEST_DIR + cp ${CYGWIN_LIBDIR}libstdc++-6.dll $DEST_DIR + cp ${CYGWIN_LIBDIR}libpng16-16.dll $DEST_DIR + + echo "Copying optional dependency dlls .." + # Don't have logic to check what was enabled, so copying all + + # SDL dlls + cp ${CYGWIN_LIBDIR}SDL.dll $DEST_DIR || true + + # Zlib dlls + cp ${CYGWIN_LIBDIR}zlib1.dll $DEST_DIR || true + + # Bzip2 dlls + cp ${CYGWIN_LIBDIR}libbz2-1.dll $DEST_DIR || true + + # libgcrypt dlls + cp ${CYGWIN_LIBDIR}libgcrypt-20.dll $DEST_DIR || true + + # Audiofile dlls + cp ${CYGWIN_LIBDIR}libaudiofile-1.dll $DEST_DIR || true + cp ${CYGWIN_LIBDIR}libFLAC-8.dll $DEST_DIR || true + cp ${CYGWIN_LIBDIR}libOGG-0.dll $DEST_DIR || true + + # LibXML2 dlls + cp ${CYGWIN_LIBDIR}libxml2-2.dll $DEST_DIR || true + cp ${CYGWIN_LIBDIR}iconv.dll $DEST_DIR || true + cp ${CYGWIN_LIBDIR}liblzma-5.dll $DEST_DIR || true + + echo "Copying libspectrum dll .." + cp /usr/local/i686-w64-mingw32/bin/libspectrum-9.dll $DEST_DIR + + # Copy them to z80 folder as well + cp -r $DEST_DIR/*.dll z80/ + + echo "Remember distribution path .." + echo "FUSE_DISTR_DIR=${DEST_DIR}" >> "$GITHUB_OUTPUT" + + echo "Done." + + shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + + - name: (9) Run tests + id: run-tests + run: | + cd ${GITHUB_WORKSPACE} + + echo "Bulding and running tests .." + #cd z80 + #./coretest.exe + echo "(skipped)" - echo "Running make dist-win32-dir .." - make install dist-win32-dir shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - name: (11) Finish + - name: (10) Create distribution file(s) + run: | + cd ${GITHUB_WORKSPACE} + + echo "Running make dist-win32-zip .." + make dist-win32-zip + shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + + - name: (10b) Rename distribution files, patch SHA1 file + id: rename-files + run: | + cd ${GITHUB_WORKSPACE} + + base_name="fuse-windows-${{ inputs.key }}" + + zip_from=${{ steps.copy-dlls.outputs.FUSE_DISTR_DIR }}.zip + zip_to="${base_name}.zip" + + echo "Renaming ZIP file from $zip_from to $zip_to" + mv $zip_from $zip_to + + sha1_from=${{ steps.copy-dlls.outputs.FUSE_DISTR_DIR }}.zip.sha1 + sha1_to="${base_name}.zip.sha1" + + echo "Renaming SHA1 file from $sha1_from to $sha1_to" + mv $sha1_from $sha1_to + + echo "Remember new file names" + echo "FUSE_DISTR_BASE=${base_name}" >> "$GITHUB_OUTPUT" + echo "FUSE_DISTR_ZIP=${zip_to}" >> "$GITHUB_OUTPUT" + echo "FUSE_DISTR_SHA1=${sha1_to}" >> "$GITHUB_OUTPUT" + + shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + + - name: (11) Upload generated artifact(s) + if: ${{ inputs.upload_artifacts }} + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.rename-files.outputs.FUSE_DISTR_BASE }} + if-no-files-found: error + path: | + ${{ steps.rename-files.outputs.FUSE_DISTR_ZIP }} + ${{ steps.rename-files.outputs.FUSE_DISTR_SHA1 }} + + - name: (12) Finish run: | echo "🍏 Finishing with status ${{ job.status }}." diff --git a/.github/workflows/deploy_build_sub.yml b/.github/workflows/deploy_build_sub.yml new file mode 100644 index 00000000..e94ade4e --- /dev/null +++ b/.github/workflows/deploy_build_sub.yml @@ -0,0 +1,119 @@ +# Reusable workflow for deploying build file(s) via FTP +name: Upload to FTP +run-name: Upload build file(s) to FTP / ${{ github.actor }} / + +on: + workflow_call: + inputs: + # Name this setup (no spaces please) + artefact: + type: string + required: true + deploy_zip: + type: boolean + required: true + deploy_sha1: + type: boolean + required: false + default: false + secrets: + DEPLOY_ZIP_PATH: + description: "Relative path that prefixes uploaded ZIP file on FTP server" + required: true + DEPLOY_ZIP_HOST: + description: "Hostname of FTP server where ZIP package will be uploaded" + required: true + DEPLOY_ZIP_USER: + description: "Username that will be used for uploading ZIP file to FTP server" + required: true + DEPLOY_ZIP_PASS: + description: "Password for user that will be used for uploading ZIP package to FTP server" + required: true + +jobs: + upload: + name: Upload to FTP + runs-on: ubuntu-latest + timeout-minutes: 5 + env: + file_path_artefact: ${{ inputs.artefact }} + file_path_zip: ${{ inputs.artefact }}.zip + file_path_sha1: ${{ inputs.artefact }}.zip.sha1 + + deploy_zip_path: ${{ secrets.DEPLOY_ZIP_PATH }} + deploy_zip_host: ${{ secrets.DEPLOY_ZIP_HOST }} + deploy_zip_user: ${{ secrets.DEPLOY_ZIP_USER }} + deploy_zip_pass: ${{ secrets.DEPLOY_ZIP_PASS }} + steps: + - name: (1) Download build artefact + uses: actions/download-artifact@v3 + with: + name: ${{ env.file_path_artefact }} + + - name: (2) Verify FTP/DEPLOY secrets are set + if: ${{ inputs.deploy_zip }} + run: | + error=0 + if [[ -z "${{ env.deploy_zip_path }}" ]]; then + echo "::error::DEPLOY_ZIP_PATH secret missing" + error=1 + fi + + if [[ -z "${{ env.deploy_zip_host }}" ]]; then + echo "::error::DEPLOY_ZIP_HOST secret missing" + error=1 + fi + + if [[ -z "${{ env.deploy_zip_user }}" ]]; then + echo "::error::DEPLOY_ZIP_USER secret missing" + error=1 + fi + + if [[ -z "${{ env.deploy_zip_pass }}" ]]; then + echo "::error::DEPLOY_ZIP_PASS secret missing" + error=1 + fi + + if [[ $error -eq 1 ]]; then + exit 1 + fi + + echo "All FTP/DEPLOY parameters set" + + - name: (3a) Prepare data before deploy (zip) + id: deploy-zip + if: ${{ inputs.deploy_zip }} + run: | + cd ${GITHUB_WORKSPACE} + echo "Content of directory:" + ls -laR + + echo "Deploying file ${{ env.file_path_zip }}" + + src="${GITHUB_WORKSPACE}/${{ env.file_path_zip }}" + dest="${{ env.deploy_zip_path }}/${{ github.ref_name }}/${{ env.file_path_zip }}" + + echo "Source file: $src" + echo "Destination file: $dest" + + echo "src=${src}" >> "$GITHUB_OUTPUT" + echo "dest=${dest}" >> "$GITHUB_OUTPUT" + + - name: (3b) 📂 Send zip file + uses: bayssmekanique/action-simple-file-upload@v1.1.3 + with: + host: "${{ env.deploy_zip_host }}" + user: "${{ env.deploy_zip_user }}" + password: "${{ env.deploy_zip_pass }}" + src: "${{ steps.deploy-zip.outputs.src }}" + dest: "${{ steps.deploy-zip.outputs.dest }}" + + - name: (3) Deploy SHA1 file (different location) + if: ${{ inputs.deploy_sha1 }} + run: | + echo "Deploying file ${{ env.file_path_sha1 }}" + echo "Not implemented yet" + + - name: (4) Finish + run: | + echo "🍏 Finishing with status ${{ job.status }}." diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml new file mode 100755 index 00000000..af63e72e --- /dev/null +++ b/.github/workflows/nightly_build.yml @@ -0,0 +1,42 @@ +name: Nightly build +run-name: Automated nightly build and pre-release + +# Executed every night (1 AM) + button +on: + schedule: + - cron: '0 1 * * *' + workflow_dispatch: + +jobs: + # Merge master from defined repo (usually official fuse repo) + catchup: + name: "Merge foreign master" + runs-on: ubuntu-latest + if: ${{ vars.PARENT_FUSE_BRANCH }} && ${{ vars.PARENT_FUSE_REPO }} + permissions: + contents: write + steps: + - name: "Checkout code" + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: "Merge fresh ${{ vars.PARENT_FUSE_BRANCH }} from ${{ vars.PARENT_FUSE_REPO }}" + run: | + git fetch --prune + git remote add repo ${{ vars.PARENT_FUSE_REPO }} + git fetch repo + git merge repo/${{ vars.PARENT_FUSE_BRANCH }} + git push + + # Build and release nightly prerelease version from master (no draft) + master: + needs: [catchup] + name: "Nightly build from master" + uses: ./.github/workflows/test_release.yml + with: + reason: "Nightly master build" + draft: false + generateReleaseNotes: true + libspectrum_branch: "master" + secrets: + RELEASE_TOKEN: "${{ secrets.RELEASE_TOKEN }}" diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml new file mode 100644 index 00000000..fbcd136f --- /dev/null +++ b/.github/workflows/test_release.yml @@ -0,0 +1,145 @@ +name: Test version of Fuse App +run-name: Build & Deploy Test version of Fuse App / ${{ github.actor }} / + +on: + # Executed upon manual request + workflow_dispatch: + inputs: + reason: + type: string + required: true + default: "Test some feature" + description: "Describe reason or content of new test release" + draft: + type: boolean + required: true + default: true + description: "If checked, will be marked as draft, needs to be manually released in UI." + generateReleaseNotes: + type: boolean + required: false + default: false + description: "Indicates if release notes should be automatically generated" + libspectrum_branch: + type: string + required: true + default: "master" + description: "Libspectrum's branch to use" + + # Reused also from nightly build workflow + workflow_call: + inputs: + reason: + type: string + required: true + default: "Test some feature" + description: "Describe reason or content of new test release" + draft: + type: boolean + required: true + description: "If checked, will be marked as draft, needs to be manually released in UI." + generateReleaseNotes: + type: boolean + required: false + default: false + description: "Indicates if release notes should be automatically generated" + libspectrum_branch: + type: string + required: false + default: "master" + description: "Libspectrum's branch to use" + secrets: + RELEASE_TOKEN: + required: true + +jobs: + + ######################################## + ### Make dependecies (Libspectrum) ### + ######################################## + + libspectrum-windows: + # Reuse libspectrum's build wokflow and artefact (all libs enabled, fake glib) + name: "Libspectrum lib" + uses: arki55/fuse-libspectrum/.github/workflows/build_windows_sub.yml@master + with: + branch: ${{ inputs.libspectrum_branch }} + key: fuse-app + # repo name is taken from var.LIBSPECTRUM_REPO + + ######################################## + ### Make Testing builds for Windows ### + ######################################## + + # Win32 UI + build-win32-ui-default: + name: "Fuse Win32 UI" + needs: [libspectrum-windows] + uses: ./.github/workflows/test_release_windows_sub.yml + with: + reason: ${{ inputs.reason }} + key: "win32-ui-default" + dependencies: "" + configure_params: "--with-win32" + verify_ui: "win32" + verify_audio: "directsound" + + # SDL1 UI+sound + build-sdl-ui-sdl-sound: + name: "Fuse SDL1 (UI + sound)" + needs: [libspectrum-windows] + uses: ./.github/workflows/test_release_windows_sub.yml + with: + reason: ${{ inputs.reason }} + key: "sdl1-ui-sdl1-sound" + dependencies: "mingw64-i686-SDL" + configure_params: "--without-win32 --with-sdl --disable-sdl2 --with-audio-driver=sdl" + verify_ui: "sdl" + verify_audio: "sdl" + verify_other: "Using SDL 2: no" + + ######################################## + ### Create release, attach ZIP files ### + ######################################## + + release: + name: "Create Testing release" + needs: + - build-win32-ui-default + - build-sdl-ui-sdl-sound + runs-on: ubuntu-latest + steps: + # Prepare friendly tag name ( slashes => _ ) + - name: (1) Prepare variables + id: prep + run: | + ref_name="${{ github.ref_name }}" + use_tag="test_${ref_name//\//_}" + echo "Tag name: ${use_tag}" + echo "use_tag=${use_tag}" >> "$GITHUB_OUTPUT" + + - name: (2) Download all generated files + uses: actions/download-artifact@v3 + + - name: (3) Created release with zip files + uses: ncipollo/release-action@v1 + with: + name: "Test build for ${{ github.ref_name }}" + # Attach all generated build zips + artifacts: "*/*.zip" + # determines structure of files in Source Forge + tag: "${{ steps.prep.outputs.use_tag }}" + # Is not an official release + prerelease: true + # Needs to be published manually? + draft: ${{ inputs.draft }} + # linked to a branch/pull request + commit: ${{ github.ref_name }} + # Special permissions needed + token: "${{ secrets.RELEASE_TOKEN }}" + # Allow updating releases + allowUpdates: true + # Generate release note? + generateReleaseNotes: ${{ inputs.generateReleaseNotes }} + # Any error should fail the build + artifactErrorsFailBuild: true diff --git a/.github/workflows/test_release_windows_sub.yml b/.github/workflows/test_release_windows_sub.yml new file mode 100644 index 00000000..3f2c0637 --- /dev/null +++ b/.github/workflows/test_release_windows_sub.yml @@ -0,0 +1,45 @@ +# Reusable workflow for creating test release (Windows builds) +name: Test version of Fuse App (Windows) +run-name: Build & Deploy Test version of Fuse App For Windows / ${{ github.actor }} / + +on: + workflow_call: + inputs: + # Description of this test build + reason: + type: string + required: true + # Build parameters (forwarded) + key: + type: string + required: true + dependencies: + type: string + required: false + configure_params: + type: string + required: true + verify_ui: + type: string + required: true + verify_audio: + type: string + required: true + verify_other: + type: string + required: false + +jobs: + + # Build Fuse App + build: + name: "Build Fuse" + uses: ./.github/workflows/build_windows_sub.yml + with: + key: "${{ inputs.key }}" + dependencies: "${{ inputs.dependencies }}" + configure_params: "${{ inputs.configure_params }} --with-test-build='Reason: ${{ inputs.reason }}\\nTriggered by: ${{ github.actor }}\\nBranch: ${{ github.ref_name }}\\nDate: #NOW#'" + fuse_version: "TEST-BUILD" + verify_ui: "${{ inputs.verify_ui }}" + verify_audio: "${{ inputs.verify_audio }}" + upload_artifacts: true diff --git a/configure.ac b/configure.ac index 84f53989..317a2e0f 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ m4_define([fuse_full_version], [fuse_major_version.fuse_minor_version.fuse_micro m4_define([fuse_rc_version], [fuse_major_version,fuse_minor_version,fuse_micro_version,fuse_nano_version]) dnl Package info -m4_define([fuse_copyright], ["(c) 1999-2021 Philip Kendall and others"]) +m4_define([fuse_copyright], ["(c) 1999-2023 Philip Kendall and others"]) m4_define([fuse_url], [http://fuse-emulator.sourceforge.net/]) m4_define([fuse_bugreport], [http://sourceforge.net/p/fuse-emulator/bugs/]) @@ -57,6 +57,23 @@ AC_DEFINE([FUSE_RC_VERSION], [fuse_rc_version], [Define version information for win32 executables]) AC_DEFINE([FUSE_COPYRIGHT], [fuse_copyright], [Define copyright of Fuse]) +dnl Configure option to specify testing build info +AC_MSG_CHECKING(testing build information) +AC_ARG_WITH(test-build, +[ --with-test-build=INFO specify testing build information], + , + unset withval +) +if test "$withval" = ""; then + echo 'not a testing build' +else + withval=${withval//#NOW#/`date -u`} + echo "$withval" + AC_DEFINE_UNQUOTED([FUSE_TEST_LINE], ["This is a special build for testing purposes:"], [Testing warning line]) + AC_DEFINE_UNQUOTED([FUSE_TEST_BUILD], ["$withval"], [Testing build information]) + test_build="$withval" +fi + dnl Checks for programs. AC_PROG_CC AM_PROG_CC_C_O @@ -1074,6 +1091,17 @@ echo "Spectranet support: ${build_spectranet}" echo "SpeccyBoot support: ${linux_tap:-no}" echo "TTX2000 S support: ${build_ttx2000s}" echo "Desktop integration: ${desktopintegration}" + +if test "${test_build}" != ""; then + echo "" + echo "*********************" + echo "*** Testing build ***" + echo "*********************" + echo "This build will display the following information" + echo " to distinguish it from official version:" + echo -e $test_build +fi + echo "" echo "Type 'make' to compile Fuse" echo "" diff --git a/fuse.c b/fuse.c index 9f67a7db..f1d181ec 100644 --- a/fuse.c +++ b/fuse.c @@ -162,6 +162,7 @@ static void creator_register_startup( void ); static void fuse_show_copyright(void); static void fuse_show_version( void ); +static void fuse_show_test_build_info( void ); static void fuse_show_help( void ); static int setup_start_files( start_files_t *start_files ); @@ -410,6 +411,14 @@ static int fuse_init(int argc, char **argv) fuse_emulation_paused = 0; movie_init(); +#ifdef FUSE_TEST_BUILD + /* Show warning in case of test build */ + ui_error( UI_ERROR_WARNING, + FUSE_TEST_LINE "\n" + FUSE_TEST_BUILD + ); +#endif + return 0; } @@ -501,6 +510,20 @@ static void fuse_show_copyright(void) static void fuse_show_version( void ) { printf( "The Free Unix Spectrum Emulator (Fuse) version " VERSION ".\n" ); + + fuse_show_test_build_info(); +} + +static void fuse_show_test_build_info( void ) +{ +#ifdef FUSE_TEST_BUILD + printf( + "\n" + FUSE_TEST_LINE "\n" + FUSE_TEST_BUILD "\n" + "\n" + ); +#endif } static void fuse_show_help( void ) diff --git a/ui/widget/error.c b/ui/widget/error.c index 23847b20..e8c610d1 100644 --- a/ui/widget/error.c +++ b/ui/widget/error.c @@ -94,6 +94,7 @@ split_message( const char *message, char ***lines, size_t *count, { const char *ptr = message; int position; + int next_line = 0; line_length *= 8; @@ -103,8 +104,14 @@ split_message( const char *message, char ***lines, size_t *count, while( *ptr ) { + /* Detect new lines */ + while( *ptr && ( *ptr ) == '\n' ) { + ptr++; + next_line=1; + } /* Skip any whitespace */ while( *ptr && isspace( *ptr ) ) ptr++; + /* End of message? */ if( *ptr == '\0' ) break; message = ptr; @@ -118,10 +125,11 @@ split_message( const char *message, char ***lines, size_t *count, message++; /* Check we've got room for the word, plus some prefixing space */ - if( position + widget_substringwidth( message, ptr - message ) + 4 - >= line_length ) { + if( (position + widget_substringwidth( message, ptr - message ) + 4 + >= line_length) || (next_line==1) ) { char **new_lines; size_t i; + next_line=0; /* If we've filled the screen, stop */ if( *count == 18 ) return 0; |