From 2183491feb574654bc3d990babd2e0ac68eb10d8 Mon Sep 17 00:00:00 2001 From: Gerald Pinder <4626052+gmpinder@users.noreply.github.com> Date: Sat, 30 Dec 2023 10:10:57 -0500 Subject: [PATCH] Add github actions for testing --- .github/CODEOWNERS | 1 + .github/dependabot.yml | 13 ++++++ .github/semantic.yml | 2 + .github/workflows/build.yml | 77 +++++++++++++++++++++++++++++++ .github/workflows/release-iso.yml | 47 +++++++++++++++++++ cosign.pub | 4 ++ 6 files changed, 144 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yml create mode 100644 .github/semantic.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release-iso.yml create mode 100644 cosign.pub diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..f6a87d2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @castrojo diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d26c3c4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + diff --git a/.github/semantic.yml b/.github/semantic.yml new file mode 100644 index 0000000..b5161df --- /dev/null +++ b/.github/semantic.yml @@ -0,0 +1,2 @@ +enabled: true +titleOnly: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e4618ef --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +# This workflow builds every branch of the repository daily at 16:30 UTC, one hour after ublue-os/nvidia builds. +# The images are also built after pushing changes or pull requests. +# The builds can also be triggered manually in the Actions tab thanks to workflow dispatch. +# Only the branch called `live` is published. + + +name: build-ublue +on: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows + schedule: + - cron: "30 16 * * *" + push: + branches: + - live + - template + - main + paths-ignore: # don't rebuild if only documentation has changed + - "**.md" + pull_request: + workflow_dispatch: + +# Only deploys the branch named "live". Ignores all other branches, to allow +# having "development" branches without interfering with GHCR image uploads. +jobs: + ublue-build: + name: Template Containerfile + runs-on: ubuntu-22.04 + permissions: + contents: read + strategy: + fail-fast: false + + matrix: +# !!! + # Add recipes for all the images you want to build here. + # Don't add module configuration files, you will get errors. + recipe: + - recipe-jp-desktop.yml + - recipe-jp-laptop.yml + - recipe-cp-laptop.yml +# !!! + + steps: + - name: Maximize build space + uses: AdityaGarg8/remove-unwanted-software@v1 + with: + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + + - uses: actions/checkout@v2 + + - uses: sigstore/cosign-installer@v3.3.0 + + - name: Install Cargo + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + + - name: Install Ublue CLI tool + run: | + cargo install --git https://gitlab.com/wunker-bunker/ublue-cli --branch github-support --locked + + - name: Install Dependencies + run: | + sudo apt-get install -y buildah skopeo + + - name: Build Image + env: + COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} + PR_EVENT_NUMBER: ${{ github.event.number }} + REGISTRY_TOKEN: ${{ github.token }} + run: | + ublue build --push -vv ./config/${{ matrix.recipe }} + + - name: Echo outputs + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live' + run: | + echo "${{ toJSON(steps.push.outputs) }}" diff --git a/.github/workflows/release-iso.yml b/.github/workflows/release-iso.yml new file mode 100644 index 0000000..90afd21 --- /dev/null +++ b/.github/workflows/release-iso.yml @@ -0,0 +1,47 @@ +on: + push: + paths: + - 'boot_menu.yml' + - '.github/workflows/release-iso.yml' + workflow_dispatch: + +name: release-iso +jobs: + release-iso: + name: Generate and Release ISOs + runs-on: ubuntu-latest + permissions: + contents: write + container: + image: fedora:39 + options: --privileged + steps: + - uses: actions/checkout@v4 + - name: Generate ISO + uses: ublue-os/isogenerator@v2.2.0 + id: isogenerator + with: + image-name: ${{ github.event.repository.name }} + installer-repo: releases + installer-major-version: 39 + boot-menu-path: boot_menu.yml + - name: install github CLI + run: | + sudo dnf install 'dnf-command(config-manager)' -y + sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + sudo dnf install gh -y + - name: Upload ISO + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + if gh release list -R ${{ github.repository_owner }}/${{ github.event.repository.name }} | grep "auto-iso"; then + gh release view auto-iso -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --json assets -q .assets[].name | xargs --no-run-if-empty -L 1 gh release delete-asset auto-iso -R ${{ github.repository_owner }}/${{ github.event.repository.name }} + gh release upload auto-iso ${{ steps.isogenerator.outputs.iso-path }} -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --clobber + else + gh release create auto-iso ${{ steps.isogenerator.outputs.iso-path }} -t ISO -n "This is an automatically generated ISO release." -R ${{ github.repository_owner }}/${{ github.event.repository.name }} + fi + - name: Upload SHA256SUM + env: + GITHUB_TOKEN: ${{ github.token }} + run: + gh release upload auto-iso ${{ steps.isogenerator.outputs.sha256sum-path }} -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --clobber diff --git a/cosign.pub b/cosign.pub new file mode 100644 index 0000000..6df9a9f --- /dev/null +++ b/cosign.pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYiEL+YiOcevJqnNY/Z+r3EQ1a1Lg +SMf9uQ8jXK7oQtAMaRD0OU06tu+Xd/ll8c4h1ZtMg2lERDf2XPjBawHT6g== +-----END PUBLIC KEY-----