mirror of
https://github.com/RetroDECK/additional-libraries.git
synced 2025-03-06 14:27:46 +00:00
Added workflow
This commit is contained in:
parent
61caa3cea5
commit
b7cf5e87ba
105
.github/workflows/build_manifest.yml
vendored
Normal file
105
.github/workflows/build_manifest.yml
vendored
Normal file
|
@ -0,0 +1,105 @@
|
|||
name: "Build manifest"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
Building_RetroDECK-manifest:
|
||||
runs-on: manifest
|
||||
#runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
# Circumventing this bug: https://github.com/flatpak/flatpak-builder/issues/317
|
||||
- name: Remove stuck mounts
|
||||
run: sudo umount -f /home/ubuntu/manifest-runner/_work/RetroDECK-manifest/RetroDECK-manifest/.flatpak-builder/rofiles/*
|
||||
continue-on-error: true
|
||||
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'true'
|
||||
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: "automation_tools/install_dependencies.sh"
|
||||
|
||||
- name: "Creating manifest manifest"
|
||||
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/update_manifest_manifest.sh"
|
||||
|
||||
- name: "[DEBUG] Outputting manifest"
|
||||
run: cat net.retrodeck.manifest.yml
|
||||
|
||||
- name: "Build flatpak"
|
||||
id: "flatpak-download"
|
||||
run: |
|
||||
flatpak-builder --user --force-clean \
|
||||
--install-deps-from=flathub \
|
||||
--install-deps-from=flathub-beta \
|
||||
--repo=${GITHUB_WORKSPACE}/manifest-repo \
|
||||
"${GITHUB_WORKSPACE}"/manifest-build-dir \
|
||||
net.retrodeck.manifest.yml
|
||||
|
||||
- name: "Exporting dir tree"
|
||||
id: tree
|
||||
run: tree -H ./ > ${GITHUB_WORKSPACE}/tree.html
|
||||
|
||||
- name: Create Artifact for RetroDECK
|
||||
run: |
|
||||
tar -czf ${GITHUB_WORKSPACE}/RetroDECK-manifest-Artifact.tar.gz -C ${GITHUB_WORKSPACE}/manifest-build-dir .
|
||||
hash=($(sha256sum ${GITHUB_WORKSPACE}/RetroDECK-manifest-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
|
||||
|
||||
- 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
|
||||
|
||||
- name: Get date
|
||||
id: date
|
||||
run: echo "DATE=$(date +'%d%m%y.%S')" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish the artifacts in a release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: "${{env.BRANCH_NAME}}-${{env.DATE}}"
|
||||
body: |
|
||||
# Release Notes
|
||||
These are the artifact of RetroDECK manifest, commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
|
||||
On branch [${{env.BRANCH_NAME}}](https://github.com/XargonWan/RetroDECK-manifest/tree/${{env.BRANCH_NAME}}).
|
||||
|
||||
artifacts: "RetroDECK-manifest-Artifact.tar.gz, tree.html"
|
||||
allowUpdates: true
|
||||
makeLatest: true
|
||||
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.manifest.yml
|
||||
# git commit -m '[AUTOMATED] Updating manifest 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 manifest after build [skip ci]'
|
||||
continue-on-error: true # TODO: would be good to update the manifest but it's broken
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue