From 620e95df7fb106c165d9a11b0a79dcb840c063f6 Mon Sep 17 00:00:00 2001 From: Juri Grabowski Date: Fri, 15 Apr 2022 22:44:53 +0200 Subject: [PATCH 1/2] add fai to master --- .github/workflows/fai.yml | 90 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/fai.yml diff --git a/.github/workflows/fai.yml b/.github/workflows/fai.yml new file mode 100644 index 0000000..e735824 --- /dev/null +++ b/.github/workflows/fai.yml @@ -0,0 +1,90 @@ +name: fai + +on: + push: + branches: + - fai + schedule: + - cron: '0 4 * * 5' + workflow_dispatch: + +env: + BRANCH: fai + GITHUB_ENDPOINT: netbootxyz/asset-mirror + DISCORD_HOOK_URL: ${{ secrets.DISCORD_HOOK_URL }} + BUILD_TYPE: direct_file + DEBIAN_FRONTEND: noninteractive + CI_TOKEN: ${{ secrets.CI_TOKEN }} + +jobs: + version-checker: + name: Version Checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: fai + + - 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: Create Release + if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.GITHUB_TAG }} + release_name: ${{ env.GITHUB_TAG }} + draft: false + prerelease: false + + - name: Upload Assets + if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' + uses: svenstaro/upload-release-action@v2 + with: + file: buildout/* + file_glob: true + overwrite: true + prerelease: false + release_name: ${{ env.GITHUB_TAG }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.GITHUB_TAG }} + + - 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 From 599bdcb9abf9ee0662bfa3821db11d3f28d2863c Mon Sep 17 00:00:00 2001 From: Juri Grabowski Date: Fri, 15 Apr 2022 23:45:34 +0200 Subject: [PATCH 2/2] add libxml2-utils --- .github/workflows/fai.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/fai.yml b/.github/workflows/fai.yml index e735824..c726201 100644 --- a/.github/workflows/fai.yml +++ b/.github/workflows/fai.yml @@ -25,6 +25,10 @@ jobs: with: ref: fai + - name: Add packages to ubuntu image + run: | + sudo apt-get -y install libxml2-utils + - name: Get SHA of actual branch instead of master run: | export GITHUB_SHA=$(git rev-parse HEAD)