Skip to content

Merge pull request #18 from openziti/dns-integration-review-fixes #16

Merge pull request #18 from openziti/dns-integration-review-fixes

Merge pull request #18 from openziti/dns-integration-review-fixes #16

Workflow file for this run

# Build per-target .ipks and publish a signed opkg feed to gh-pages.
#
# Per project rule: this YAML is glue only. All build / stage / sign logic
# lives in tools/*.sh so a maintainer can reproduce the same run locally
# with the same env vars.
#
# Required repo secrets:
# USIGN_SECRET_KEY -- contents of build/keys/sec.key (multi-line). See
# docs/feed-publishing-setup.md for first-time setup.
#
# GITHUB_TOKEN is provided automatically by Actions and is forwarded to the
# gh-pages deploy step.
name: publish-feed
on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'LICENSE'
- '.gitignore'
workflow_dispatch:
permissions:
contents: write
jobs:
build-sdk:
name: build-sdk (${{ matrix.target }})
runs-on: ubuntu-latest
# New arches (arm_cortex-a7_neon-vfpv4, mipsel_24kc) are unverified --
# mark them experimental so a build failure on those does not block the
# feed publish for the proven targets.
continue-on-error: ${{ matrix.experimental == true }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64_cortex-a53
- target: x86_64
- target: arm_cortex-a7_neon-vfpv4
experimental: true
- target: mipsel_24kc
experimental: true
steps:
- uses: actions/checkout@v4
- name: Cache SDK Docker image
id: docker-cache
uses: actions/cache@v4
with:
path: /tmp/sdk-image.tar
key: sdk-img-${{ matrix.target }}-${{ hashFiles('tools/Dockerfile', 'tools/build-sdk.sh') }}
- name: Restore Docker image from cache
if: steps.docker-cache.outputs.cache-hit == 'true'
run: docker load -i /tmp/sdk-image.tar
- name: Build ziti-edge-tunnel + llhttp9
run: bash tools/build-sdk.sh -p ziti-edge-tunnel -t ${{ matrix.target }}
- name: Build luci-app-ziti
if: matrix.target == 'aarch64_cortex-a53'
run: bash tools/build-sdk.sh -p luci-app-ziti -t ${{ matrix.target }}
- name: Save Docker image to cache
if: steps.docker-cache.outputs.cache-hit != 'true'
run: docker save openwrt-openziti-sdk:${{ matrix.target }}-23.05.5 -o /tmp/sdk-image.tar
- name: Collect openziti ipks
run: bash tools/collect-ipks.sh ${{ matrix.target }}
- name: Upload per-target artifacts
uses: actions/upload-artifact@v4
with:
name: ipks-${{ matrix.target }}
path: build/collect/${{ matrix.target }}/
- name: Upload luci ipk (once)
if: matrix.target == 'aarch64_cortex-a53'
uses: actions/upload-artifact@v4
with:
name: ipks-luci
path: build/collect/luci/
build-router-binaries:
name: build-router-binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Go module + build cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-${{ hashFiles('tools/build-ziti-router.sh') }}
- name: Build ziti static binaries (arm64 + amd64)
run: bash tools/build-ziti-router.sh
- name: Upload router binaries
uses: actions/upload-artifact@v4
with:
name: router-binaries
path: package/ziti-router/files/binaries/
build-router:
name: build-ziti-router (${{ matrix.target }})
runs-on: ubuntu-latest
needs: [build-sdk, build-router-binaries]
strategy:
fail-fast: false
matrix:
target: [aarch64_cortex-a53, x86_64]
steps:
- uses: actions/checkout@v4
- name: Restore SDK Docker image from cache
uses: actions/cache@v4
with:
path: /tmp/sdk-image.tar
key: sdk-img-${{ matrix.target }}-${{ hashFiles('tools/Dockerfile', 'tools/build-sdk.sh') }}
- name: Load Docker image
run: test -f /tmp/sdk-image.tar && docker load -i /tmp/sdk-image.tar || true
- name: Download router binaries
uses: actions/download-artifact@v4
with:
name: router-binaries
path: package/ziti-router/files/binaries/
- name: Build ziti-router .ipk for target
run: bash tools/build-sdk.sh -p ziti-router -t ${{ matrix.target }}
- name: Collect router ipk
run: bash tools/collect-ipks.sh ${{ matrix.target }}
- name: Upload router artifact
uses: actions/upload-artifact@v4
with:
name: ipks-router-${{ matrix.target }}
path: build/collect/${{ matrix.target }}/
publish:
name: publish-feed
runs-on: ubuntu-latest
needs: [build-sdk, build-router]
steps:
- uses: actions/checkout@v4
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: build/artifacts-raw
- name: Merge artifact dirs into per-target layout
run: bash tools/merge-artifacts.sh build/artifacts-raw build/artifacts
- name: Stage, sign, and produce feed
env:
USIGN_SECRET_KEY: ${{ secrets.USIGN_SECRET_KEY }}
BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
ARTIFACT_ROOT: ${{ github.workspace }}/build/artifacts
run: bash tools/publish-feed-ci.sh
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/feed
publish_branch: gh-pages
force_orphan: true