🌑️ Nightly builds #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🌑️ Nightly builds | |
# Create nightly builds at the end of every day | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
############################################### | |
###### rpi_ws281x submodule update check ###### | |
############################################### | |
update_submodule: | |
name: 🔁 Update Submodule rpi_ws281x | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⬇ Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: hyperion-project/hyperion.ng | |
persist-credentials: false | |
fetch-depth: 0 | |
submodules: recursive | |
- name: 🔁 Update Submodule rpi_ws281x | |
id: update | |
run: git submodule update --remote --recursive dependencies/external/rpi_ws281x | |
- name: ✅ Check git status | |
id: status | |
run: echo "status=$(git status -s)" >> $GITHUB_OUTPUT | |
- name: ✏️ Add/Commit changes | |
if: ${{ steps.status.outputs.status }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Hyperion-Bot" | |
git config --local diff.ignoreSubmodules dirty | |
git commit -am "Update submodule rpi_ws281x" | |
- name: 📦 Push changes | |
if: ${{ env.SECRET_BOT_TOKEN != null && steps.status.outputs.status }} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.HYPERION_BOT_TOKEN }} | |
repository: hyperion-project/hyperion.ng | |
branch: master | |
env: | |
SECRET_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }} | |
################################## | |
###### APT/DNF commit check ###### | |
################################## | |
check: | |
name: 🔀 Compare Repository with current master | |
needs: [update_submodule] | |
runs-on: ubuntu-latest | |
outputs: | |
build-apt-nightly: ${{ steps.apt-build-necessary.outputs.commit-has-changed }} | |
build-dnf-nightly: ${{ steps.dnf-build-necessary.outputs.commit-has-changed }} | |
current-head-sha: ${{ steps.determine-head-sha.outputs.head-sha }} | |
steps: | |
- name: ⬇ Get current master head sha | |
id: determine-head-sha | |
run: echo "head-sha=$(git ls-remote https://github.com/hyperion-project/hyperion.ng HEAD | cut -f 1)" >> $GITHUB_OUTPUT | |
- name: ✅ Check if commit has changed (APT) | |
id: apt-build-necessary | |
run: | | |
if wget --spider "https://nightly.apt.releases.hyperion-project.org/${{ steps.determine-head-sha.outputs.head-sha }}" 2>/dev/null; then | |
echo "commit-has-changed=false" >> $GITHUB_OUTPUT | |
else | |
echo "commit-has-changed=true" >> $GITHUB_OUTPUT | |
fi | |
- name: ✅ Check if commit has changed (DNF) | |
id: dnf-build-necessary | |
run: | | |
if wget --spider "https://nightly.dnf.releases.hyperion-project.org/${{ steps.determine-head-sha.outputs.head-sha }}" 2>/dev/null; then | |
echo "commit-has-changed=false" >> $GITHUB_OUTPUT | |
else | |
echo "commit-has-changed=true" >> $GITHUB_OUTPUT | |
fi | |
# Build DEB Packages for APT Repository | |
deb_build: | |
name: 👷 Build DEB Packages | |
if: ${{ needs.check.outputs.build-apt-nightly == 'true' }} | |
needs: [check] | |
uses: ./.github/workflows/build_deb.yml | |
secrets: inherit | |
with: | |
head_sha: ${{ needs.check.outputs.current-head-sha }} | |
nightly: true | |
upload: true | |
# Build RPM Packages for DNF Repository | |
rpm_build: | |
name: 👷 Build RPM Packages | |
if: ${{ needs.check.outputs.build-dnf-nightly == 'true' }} | |
needs: [check] | |
uses: ./.github/workflows/build_rpm.yml | |
secrets: inherit | |
with: | |
head_sha: ${{ needs.check.outputs.current-head-sha }} | |
nightly: true | |
upload: true | |
# Publish RPM Packages to DNF Repository | |
publish_packages: | |
name: 🚀 Publish Packages | |
if: ${{ needs.check.outputs.build-apt-nightly == 'true' || needs.check.outputs.build-dnf-nightly == 'true' }} | |
needs: [ check, deb_build, rpm_build ] | |
uses: ./.github/workflows/publish_deb_rpm.yml | |
secrets: inherit | |
with: | |
head_sha: ${{ needs.check.outputs.current-head-sha }} | |
nightly: true | |
publish: true |