Skip to content

Commit e0dcae2

Browse files
committed
Updating workflow automation
1 parent e98aad3 commit e0dcae2

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/kairos.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: kairos
2+
3+
on:
4+
push:
5+
branches:
6+
- kairos
7+
paths-ignore:
8+
- '.github/workflows/**'
9+
schedule:
10+
- cron: '0 4 * * *'
11+
workflow_dispatch:
12+
13+
env:
14+
BRANCH: kairos
15+
GITHUB_ENDPOINT: netbootxyz/external-versions
16+
DISCORD_HOOK_URL: ${{ secrets.DISCORD_HOOK_URL }}
17+
BUILD_TYPE: versioning
18+
DEBIAN_FRONTEND: noninteractive
19+
CI_TOKEN: ${{ secrets.CI_TOKEN }}
20+
21+
jobs:
22+
version-checker:
23+
name: Version Checker
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: kairos
29+
30+
- name: Get SHA of actual branch instead of master
31+
run: |
32+
export GITHUB_SHA=$(git rev-parse HEAD)
33+
echo "GITHUB_SHA=$GITHUB_SHA" >> $GITHUB_ENV
34+
35+
- name: Retrieve latest version from upstream and set vars
36+
run: |
37+
export EXTERNAL_VERSION=$(sudo bash version.sh)
38+
echo "EXTERNAL_VERSION=$EXTERNAL_VERSION" >> $GITHUB_ENV
39+
wget https://raw.githubusercontent.com/netbootxyz/build-pipelines/master/build.sh && chmod +x build.sh
40+
git config --global user.name netboot-ci
41+
git config --global user.email [email protected]
42+
43+
- name: Check version
44+
id: compare
45+
run: ./build.sh ${{ env.BUILD_TYPE }} ${{ env.EXTERNAL_VERSION }}
46+
continue-on-error: true
47+
48+
- name: Build release
49+
if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success'
50+
run: |
51+
./build.sh releases ${{ env.EXTERNAL_VERSION }}
52+
53+
- name: Notify Discord on failure
54+
if: failure()
55+
run: |
56+
./build.sh discord versionbad
57+
58+
- name: Notify Discord on completion
59+
if: steps.compare.outcome == 'success' && steps.compare.conclusion == 'success' && success()
60+
run: |
61+
./build.sh discord versiongood

0 commit comments

Comments
 (0)