From 558a4845e844d7918036db05ce5b26250b933b2f Mon Sep 17 00:00:00 2001 From: netboot-ci Date: Sat, 10 Aug 2024 00:38:46 +0000 Subject: [PATCH] Updating workflow automation --- ...t-23.10-amd64.yml => mint-22-cinnamon.yml} | 10 +-- ...tboot-23.10-arm64.yml => mint-22-mate.yml} | 10 +-- .github/workflows/mint-22-xfce.yml | 85 +++++++++++++++++++ 3 files changed, 95 insertions(+), 10 deletions(-) rename .github/workflows/{ubuntu-netboot-23.10-amd64.yml => mint-22-cinnamon.yml} (93%) rename .github/workflows/{ubuntu-netboot-23.10-arm64.yml => mint-22-mate.yml} (93%) create mode 100644 .github/workflows/mint-22-xfce.yml diff --git a/.github/workflows/ubuntu-netboot-23.10-amd64.yml b/.github/workflows/mint-22-cinnamon.yml similarity index 93% rename from .github/workflows/ubuntu-netboot-23.10-amd64.yml rename to .github/workflows/mint-22-cinnamon.yml index 7885f6d..9615d2e 100644 --- a/.github/workflows/ubuntu-netboot-23.10-amd64.yml +++ b/.github/workflows/mint-22-cinnamon.yml @@ -1,9 +1,9 @@ -name: ubuntu-netboot-23.10-amd64 +name: mint-22-cinnamon on: push: branches: - - ubuntu-netboot-23.10-amd64 + - mint-22-cinnamon paths-ignore: - '.github/workflows/**' schedule: @@ -11,10 +11,10 @@ on: workflow_dispatch: env: - BRANCH: ubuntu-netboot-23.10-amd64 + BRANCH: mint-22-cinnamon GITHUB_ENDPOINT: netbootxyz/ubuntu-squash DISCORD_HOOK_URL: ${{ secrets.DISCORD_HOOK_URL }} - BUILD_TYPE: iso_extraction + BUILD_TYPE: initrd_patch DEBIAN_FRONTEND: noninteractive CI_TOKEN: ${{ secrets.CI_TOKEN }} @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ubuntu-netboot-23.10-amd64 + ref: mint-22-cinnamon - name: Get SHA of actual branch instead of master run: | diff --git a/.github/workflows/ubuntu-netboot-23.10-arm64.yml b/.github/workflows/mint-22-mate.yml similarity index 93% rename from .github/workflows/ubuntu-netboot-23.10-arm64.yml rename to .github/workflows/mint-22-mate.yml index 7cd3b22..2ee241c 100644 --- a/.github/workflows/ubuntu-netboot-23.10-arm64.yml +++ b/.github/workflows/mint-22-mate.yml @@ -1,9 +1,9 @@ -name: ubuntu-netboot-23.10-arm64 +name: mint-22-mate on: push: branches: - - ubuntu-netboot-23.10-arm64 + - mint-22-mate paths-ignore: - '.github/workflows/**' schedule: @@ -11,10 +11,10 @@ on: workflow_dispatch: env: - BRANCH: ubuntu-netboot-23.10-arm64 + BRANCH: mint-22-mate GITHUB_ENDPOINT: netbootxyz/ubuntu-squash DISCORD_HOOK_URL: ${{ secrets.DISCORD_HOOK_URL }} - BUILD_TYPE: iso_extraction + BUILD_TYPE: initrd_patch DEBIAN_FRONTEND: noninteractive CI_TOKEN: ${{ secrets.CI_TOKEN }} @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ubuntu-netboot-23.10-arm64 + ref: mint-22-mate - name: Get SHA of actual branch instead of master run: | diff --git a/.github/workflows/mint-22-xfce.yml b/.github/workflows/mint-22-xfce.yml new file mode 100644 index 0000000..b313d6f --- /dev/null +++ b/.github/workflows/mint-22-xfce.yml @@ -0,0 +1,85 @@ +name: mint-22-xfce + +on: + push: + branches: + - mint-22-xfce + paths-ignore: + - '.github/workflows/**' + schedule: + - cron: '0 4 * * 4' + workflow_dispatch: + +env: + BRANCH: mint-22-xfce + GITHUB_ENDPOINT: netbootxyz/ubuntu-squash + DISCORD_HOOK_URL: ${{ secrets.DISCORD_HOOK_URL }} + BUILD_TYPE: initrd_patch + DEBIAN_FRONTEND: noninteractive + CI_TOKEN: ${{ secrets.CI_TOKEN }} + +jobs: + version-checker: + name: Version Checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: mint-22-xfce + + - name: Get SHA of actual branch instead of master + run: | + export GITHUB_SHA=$(git rev-parse HEAD) + echo "GITHUB_SHA=$GITHUB_SHA" >> $GITHUB_ENV + + - name: Retrieve latest version from upstream and set vars + run: | + export EXTERNAL_VERSION=$(sudo bash version.sh) + echo "EXTERNAL_VERSION=$EXTERNAL_VERSION" >> $GITHUB_ENV + export GITHUB_TAG=${EXTERNAL_VERSION}-$(echo ${{ env.GITHUB_SHA }} | cut -c1-8) + echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV + wget https://raw.githubusercontent.com/netbootxyz/build-pipelines/master/build.sh && chmod +x build.sh + + - name: Compare tag + id: compare + run: ./build.sh compare ${{ env.GITHUB_TAG }} + continue-on-error: true + + - name: Build if newer tag is available + if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' + run: | + ./build.sh build ${{ env.BUILD_TYPE }} + git tag ${{ env.GITHUB_TAG }} + + - name: Generate Release Notes + run: | + echo "Release generated for Branch: **${{ env.BRANCH }}**" > ${{ github.workspace }}-CHANGELOG.txt + + - name: Create release and upload assets + if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GITHUB_TAG }} + name: ${{ env.GITHUB_TAG }} + draft: false + prerelease: false + files: buildout/* + token: ${{ secrets.GITHUB_TOKEN }} + body_path: ${{ github.workspace }}-CHANGELOG.txt + + - name: Generate endpoints + if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' + run: | + git config --global user.name netboot-ci + git config --global user.email netboot-ci@netboot.xyz + ./build.sh endpoints ${{ env.GITHUB_TAG }} + + - name: Notify Discord on failure + if: failure() + run: | + ./build.sh discord failure + + - name: Notify Discord on completion + if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' && success() + run: | + ./build.sh discord success