MAME/.github/workflows/build_mame.yml

105 lines
3.6 KiB
YAML
Raw Permalink Normal View History

2023-12-22 09:16:54 +00:00
name: "Build MAME"
2023-12-22 08:47:03 +00:00
on:
push:
2024-01-23 09:21:24 +00:00
branches:
- main
2023-12-22 08:47:03 +00:00
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:
runs-on: retrodeck
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'
2024-01-23 09:08:54 +00:00
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
2023-12-22 09:16:54 +00:00
- 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
2024-01-23 09:23:39 +00:00
- name: "Build flatpak"
id: "flatpak-download"
run: |
flatpak-builder --user --force-clean \
--install-deps-from=flathub \
--install-deps-from=flathub-beta \
--repo=${GITHUB_WORKSPACE}/mame-repo \
"${GITHUB_WORKSPACE}"/mame-build-dir \
net.retrodeck.mame.yml
- name: "Exporting dir tree"
id: tree
run: tree -H ./ > ${GITHUB_WORKSPACE}/tree.html
2024-01-23 09:23:39 +00:00
- name: Create Artifact for RetroDECK
run: |
2024-01-23 12:36:20 +00:00
tar -czf ${GITHUB_WORKSPACE}/RetroDECK-MAME-Artifact.tar.gz -C ${GITHUB_WORKSPACE}/mame-build-dir .
2024-01-23 09:23:39 +00:00
hash=($(sha256sum ${GITHUB_WORKSPACE}/RetroDECK-MAME-Artifact.tar.gz))
echo $hash > ${GITHUB_WORKSPACE}/RetroDECK-Artifact-cooker.sha
mv -f RetroDECK-Artifact-cooker.* ${{ secrets.ARTIFACT_REPO }}
continue-on-error: true
timeout-minutes: 1440
2024-01-23 08:40:40 +00:00
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
2024-01-23 09:12:03 +00:00
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV
2023-12-22 08:47:03 +00:00
2024-01-23 08:53:28 +00:00
- name: Get date
id: date
2024-01-23 09:21:24 +00:00
run: echo "DATE=$(date +'%d%m%y.%S')" >> $GITHUB_ENV
2024-01-23 08:53:28 +00:00
- name: Publish the artifacts in a release
2023-12-22 09:16:54 +00:00
uses: ncipollo/release-action@v1
with:
2024-01-23 08:53:28 +00:00
tag: "${{env.BRANCH_NAME}}-${{env.DATE}}"
2023-12-22 09:16:54 +00:00
body: |
2024-01-23 09:19:14 +00:00
# Release Notes
2023-12-22 10:03:23 +00:00
These are the artifact of RetroDECK MAME, commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
On branch [${{env.BRANCH_NAME}}](https://github.com/XargonWan/RetroDECK-MAME/tree/${{env.BRANCH_NAME}}).
2023-12-22 09:16:54 +00:00
artifacts: "RetroDECK-MAME-Artifact.tar.gz, tree.html"
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
# - name: "Committing changes"
# with:
# github_token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
# run: |
# git config user.name "GitHub Actions"
# git config user.email "actions@github.com"
# git add * net.retrodeck.mame.yml
# git commit -m '[AUTOMATED] Updating MAME after build [skip ci]'
# git push origin main
# continue-on-error: true # TODO: would be good to update the manifest but it's broken
- name: GitHub Commit & Push
uses: actions-js/push@v1.4
with:
github_token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
message: '[AUTOMATED] Updating MAME after build [skip ci]'
continue-on-error: true # TODO: would be good to update the manifest but it's broken
2023-12-22 10:03:23 +00:00
2023-12-22 09:16:54 +00:00