Refactor steps into action

This commit is contained in:
Johannes Lorenz
2025-03-22 16:56:27 +01:00
parent db95ce2062
commit 884474b6e3
2 changed files with 44 additions and 29 deletions

View File

@@ -0,0 +1,37 @@
name: Extract Artifact
description: Waits for build, downloads and extracts the artifact
inputs:
check-name:
description: "Check name to wait for"
required: true
artifact-name:
description: "Name of the artifact to download"
required: true
runs:
using: "composite"
steps:
- name: Wait for build
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-name: ${{ inputs.check-name }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
name: ${{ inputs.artifact-name }}
- name: Extract artifact (Linux)
if: runner.os == 'Linux'
run: |
chmod +x lmms-*.AppImage
./lmms-*.AppImage --appimage-extract
- name: Mount DMG (macOS)
if: runner.os == 'macOS'
run: |
hdiutil attach lmms-*.dmg -mountpoint ~/tmpvolume
cp -R ~/tmpvolume/LMMS.app /tmp/

View File

@@ -19,22 +19,11 @@ jobs:
name: help-linux-${{ matrix.config.arch }}
runs-on: ${{ matrix.config.runner }}
steps:
- name: wait for build
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-name: linux-${{ matrix.config.arch }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
name: linux${{ matrix.config.suffix }}
- name: Extract artifact
run: |
chmod +x lmms-*.AppImage
./lmms-*.AppImage --appimage-extract
uses: ./.github/actions/extract-artifact
with:
check-name: linux-${{ matrix.config.arch }}
artifact-name: linux${{ matrix.config.suffix }}
- name: Display help
run: |
cd squashfs-root/
@@ -51,22 +40,11 @@ jobs:
name: help-macos-${{ matrix.config.arch }}
runs-on: ${{ matrix.config.runner }}
steps:
- name: wait for build
uses: lewagon/wait-on-check-action@v1.3.4
- name: Extract artifact
uses: ./.github/actions/extract-artifact
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
check-name: macos-${{ matrix.config.arch }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
name: macos-${{ matrix.config.arch }}
- name: Mount the DMG
run: |
hdiutil attach lmms-*.dmg -mountpoint ~/tmpvolume
cp -R ~/tmpvolume/LMMS.app /tmp/
artifact-name: macos-${{ matrix.config.arch }}
- name: Display help
run: |
/tmp/LMMS.app/Contents/MacOS/lmms --help | grep "Usage: lmms"