Publish Release #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |