MAME/.github/workflows/build_mame.yml

80 lines
2.6 KiB
YAML
Raw Normal View History

2023-12-22 09:16:54 +00:00
name: "Build MAME"
2023-12-22 08:47:03 +00:00
on:
push:
workflow_dispatch:
2023-12-22 09:16:54 +00:00
2023-12-22 08:47:03 +00:00
jobs:
2023-12-22 10:12:14 +00:00
Building_RetroDECK-MAME:
2023-12-22 14:42:33 +00:00
runs-on: mame
#runs-on: ubuntu-latest
2023-12-22 08:47:03 +00:00
steps:
2023-12-22 09:16:54 +00:00
# Circumventing this bug: https://github.com/flatpak/flatpak-builder/issues/317
- name: Remove stuck mounts
run: sudo umount -f /home/ubuntu/mame-runner/_work/RetroDECK-MAME/RetroDECK-MAME/.flatpak-builder/rofiles/*
2023-12-22 09:16:54 +00:00
continue-on-error: true
- name: Clone repo
uses: actions/checkout@v3
with:
submodules: 'true'
- name: "Install dependencies"
run: "automation_tools/install_dependencies.sh"
- name: "Creating MAME manifest"
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/update_mame_manifest.sh"
- name: "[DEBUG] Outputting manifest"
2023-12-22 10:03:23 +00:00
run: cat net.retrodeck.mame.yml
2023-12-22 09:16:54 +00:00
2023-12-22 10:03:23 +00:00
- name: "Build flatpak"
2023-12-22 09:16:54 +00:00
id: "flatpak-download"
run: |
2023-12-22 10:03:23 +00:00
flatpak-builder --user --force-clean \
--install-deps-from=flathub \
--install-deps-from=flathub-beta \
--repo=${GITHUB_WORKSPACE}/mame-repo \
2023-12-22 10:53:50 +00:00
"${GITHUB_WORKSPACE}"/mame-build-dir \
2023-12-22 10:03:23 +00:00
net.retrodeck.mame.yml
- name: Create Artifact for RetroDECK
2023-12-22 09:16:54 +00:00
run: |
2023-12-22 10:03:23 +00:00
tar -czf ${GITHUB_WORKSPACE}/RetroDECK-MAME-Artifact.tar.gz -C ${GITHUB_WORKSPACE}/mame-repo .
hash=($(sha256sum ${GITHUB_WORKSPACE}/RetroDECK-MAME-Artifact.tar.gz))
2023-12-22 09:16:54 +00:00
echo $hash > ${GITHUB_WORKSPACE}/RetroDECK-Artifact-cooker.sha
mv -f RetroDECK-Artifact-cooker.* ${{ secrets.ARTIFACT_REPO }}
continue-on-error: true
timeout-minutes: 1440
2023-12-22 09:16:54 +00:00
- name: Set environment variable with current branch name
run: echo "GITHUB_REF_SLUG=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
- name: Get branch name
id: branch_name
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV
2023-12-22 08:47:03 +00:00
2023-12-22 09:16:54 +00:00
- name: Publish the flatpak in a new cooker release
uses: ncipollo/release-action@v1
with:
tag: "${{env.BRANCH_NAME}}-${{ env.buildid }}"
body: |
# Release Notes (Cooker)
2023-12-22 10:03:23 +00:00
These are the artifact of RetroDECK MAME, commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
2023-12-22 09:16:54 +00:00
On branch [${{env.BRANCH_NAME}}](https://github.com/XargonWan/RetroDECK/tree/${{env.BRANCH_NAME}}).
2023-12-22 10:03:23 +00:00
artifacts: "RetroDECK-MAME-Artifact.tar.gz"
2023-12-22 09:16:54 +00:00
allowUpdates: true
2023-12-22 10:03:23 +00:00
makeLatest: true
2023-12-22 09:16:54 +00:00
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
continue-on-error: true
2023-12-22 10:03:23 +00:00
- name: "Committing changes"
uses: EndBug/add-and-commit@v9.1.3
2023-12-22 09:16:54 +00:00