-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (100 loc) · 4 KB
/
publish_release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Publish Release
on:
repository_dispatch:
types:
- Publish Release
env:
REF: ${{ github.event.client_payload.ref || 'dev' }}
DEBOS_REF: ${{ github.event.client_payload.debos_ref || github.event.client_payload.ref }}
CORE_REF: ${{ github.event.client_payload.core_ref || github.event.client_payload.ref }}
PLATFORMS: "rpi4 opi5"
UPLOAD_URL: "https://download.neonaiservices.com"
OUTPUT_DIR: [email protected]:/home/neon/nginx/www/neon_os
DO_CORE: ${{ contains(fromJson('["neon-debos", "neon-core"]'), github.event.client_payload.repo) }}
DO_NODE: ${{ contains(fromJson('["neon-debos", "neon-nodes"]'), github.event.client_payload.repo) }}
jobs:
build_images:
runs-on: image-builder
steps:
- name: Log Job
run: |
echo "REF=${{env.REF}}"
echo "DEBOS_REF=${{env.DEBOS_REF}}"
echo "CORE_REF=${{env.CORE_REF}}"
echo "PLATFORMS=${{env.PLATFORMS}}"
echo "UPLOAD_URL=${{env.UPLOAD_URL}}"
echo "OUTPUT_DIR=${{env.OUTPUT_DIR}}"
echo "DO_CORE=${{env.DO_CORE}}"
echo "DO_NODE=${{env.DO_NODE}}"
- name: Checkout Debos Repository
uses: actions/checkout@v4
with:
ref: ${{ env.DEBOS_REF }}
repository: NeonGeckoCom/neon_debos
path: action/neon_debos
lfs: False
- name: Check for Debos base image downloads
run: |
[ -f action/neon_debos/base_images/download_base_images.py ] && \
python3 action/neon_debos/base_images/download_base_images.py || echo "Using repo-cached base images"
- name: Export keys for image build
run: |
mkdir -p action/neon_debos/overlays/80-google-json-overlay/home/neon/.local/share/neon
echo ${GOOGLE_KEY}>action/neon_debos/overlays/80-google-json-overlay/home/neon/.local/share/neon/google.json
env:
GOOGLE_KEY: ${{secrets.google_api_key}}
- name: Checkout NeonOS Repository
uses: actions/checkout@v3
with:
repository: NeonGeckoCom/neon-os
path: action/neon-os
ref: master
- name: Run Neon OS Core Build
if: env.DO_CORE == 'true'
run: |
bash "${{ github.workspace }}/action/neon-os/scripts/build_image.sh" \
"${{ github.workspace }}/action/neon_debos" \
"${{env.CORE_REF}}" \
"debian-neon-image.yml" \
"${{env.PLATFORMS}}" \
"${{env.OUTPUT_DIR}}" \
"${{env.UPLOAD_URL}}" \
"${{env.REF}}"
- name: Run Neon OS Node Build
if: env.DO_NODE == 'true'
run: |
bash "${{ github.workspace }}/action/neon-os/scripts/build_image.sh" \
"${{ github.workspace }}/action/neon_debos" \
"${{env.CORE_REF}}" \
"debian-node-image.yml" \
"${{env.PLATFORMS}}" \
"${{env.OUTPUT_DIR}}" \
"${{env.UPLOAD_URL}}" \
"${{env.REF}}"
- name: Stop Docker Build Containers
if: failure() || cancelled()
run: |
docker kill neon_debos_ghaction*
- name: Update Metadata
id: metadata
run: |
python3 "${{ github.workspace }}/action/neon-os/scripts/update_metadata.py" ${{env.REF}}
echo ::set-output name=version::$(grep "tag" action/neon-os/release_notes.md | cut -d'=' -f2)
- name: Commit Metadata Updates
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Release ${{ steps.metadata.outputs.version }}
repository: "${{ github.workspace }}/action/neon-os/"
- name: Create Pre-release
uses: ncipollo/release-action@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
tag: ${{steps.metadata.outputs.version}}
commit: ${{ github.ref }}
prerelease: true
bodyFile: "${{ github.workspace }}/action/neon-os/release_notes.md"
- name: Upload Build Logs
uses: actions/upload-artifact@v4
with:
name: Debos logs
path: action/neon-os/*.log