From 835e1e7e208d7f4544f32ad2ead8a13e5c417ae8 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 22 Mar 2025 18:24:06 +0100 Subject: [PATCH] Add version check --- .github/actions/extract-artifact/action.yml | 5 ++ .github/workflows/run-help.yml | 7 +++ .github/workflows/run-version.yml | 63 +++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/workflows/run-version.yml diff --git a/.github/actions/extract-artifact/action.yml b/.github/actions/extract-artifact/action.yml index 94332ba10..23b1ab097 100644 --- a/.github/actions/extract-artifact/action.yml +++ b/.github/actions/extract-artifact/action.yml @@ -40,3 +40,8 @@ runs: run: | hdiutil attach lmms-*.dmg -mountpoint ~/tmpvolume cp -R ~/tmpvolume/LMMS.app /tmp/ + + # Windows: Not working because (1) #7732 and (2) the unzip failed + #- name: Unpack installer (Windows) + # if: runner.os == 'Windows' + # run: Start-Process @(gci build/lmms-*.exe)[0] -ArgumentList /S -Wait diff --git a/.github/workflows/run-help.yml b/.github/workflows/run-help.yml index 052fe2da4..d930ababf 100644 --- a/.github/workflows/run-help.yml +++ b/.github/workflows/run-help.yml @@ -54,3 +54,10 @@ jobs: - name: Display help run: | /tmp/LMMS.app/Contents/MacOS/lmms --help | grep "Usage: lmms" + +# Windows (does not work due to actions/extract-artifact issues) +# - name: Display help +# run: > +# $result = & "${env:ProgramFiles${{ matrix.config.programfiles-suffix }}}/LMMS/lmms.exe" "--help" | +# Select-String "Usage: lmms"; +# if($result.Matches.Count -eq 0) { exit 1 } diff --git a/.github/workflows/run-version.yml b/.github/workflows/run-version.yml new file mode 100644 index 000000000..0b38c59e9 --- /dev/null +++ b/.github/workflows/run-version.yml @@ -0,0 +1,63 @@ +--- +name: run-version +'on': [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + version-linux: + strategy: + fail-fast: false + matrix: + config: + - arch: 'x86_64' + runner: 'ubuntu-latest' + suffix: '' + - arch: 'arm64' + runner: 'ubuntu-24.04-arm' + suffix: '-arm64' + name: version-linux-${{ matrix.config.arch }} + runs-on: ${{ matrix.config.runner }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Extract artifact + uses: ./.github/actions/extract-artifact + with: + check-name: linux-${{ matrix.config.arch }} + artifact-name: linux${{ matrix.config.suffix }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Display version + run: | + cd squashfs-root/ + ./AppRun --version | grep "Copyright (c) .* LMMS Developers" + version-macos: + strategy: + fail-fast: false + matrix: + config: + - arch: 'x86_64' + runner: 'macos-latest' + - arch: 'arm64' + runner: 'macos-latest' + name: version-macos-${{ matrix.config.arch }} + runs-on: ${{ matrix.config.runner }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Extract artifact + uses: ./.github/actions/extract-artifact + with: + check-name: macos-${{ matrix.config.arch }} + artifact-name: macos-${{ matrix.config.arch }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Display version + run: | + /tmp/LMMS.app/Contents/MacOS/lmms --version | grep "Usage: lmms" + +# Windows (does not work due to actions/extract-artifact issues) +# - name: Display version +# run: > +# $result = & "${env:ProgramFiles${{ matrix.config.programfiles-suffix }}}/LMMS/lmms.exe" "--version" | +# Select-String -Pattern "Copyright \(c\) .* LMMS Developers"; +# if($result.Matches.Count -eq 0) { exit 1 }