Refactor steps into action
This commit is contained in:
37
.github/actions/extract-artifact/action.yml
vendored
Normal file
37
.github/actions/extract-artifact/action.yml
vendored
Normal 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/
|
||||
36
.github/workflows/run-help.yml
vendored
36
.github/workflows/run-help.yml
vendored
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user