Skip to content

bump dnsdist to 1.9.6 #11

bump dnsdist to 1.9.6

bump dnsdist to 1.9.6 #11

Workflow file for this run

name: CI
on:
push:
branches:
main
paths-ignore:
- 'README.md'
- 'update_matrix.py'
env:
git-author-name: Peter van Dijk
git-author-email: peter.van.dijk@powerdns.com
owrt-package: dnsdist # actually only used for page templating
repo-name: pdns
repo-owner: PowerDNS
repo-url: https://repo.powerdns.com/openwrt
pkgs: dnsdist # for building
jobs:
matrix-setup:
name: Matrix Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: get-matrix
name: Get matrix
run: echo "matrix=$(<matrix.json)" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}
build-packages:
name: Build Packages
runs-on: ubuntu-latest
needs: matrix-setup
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix-setup.outputs.matrix) }}
env:
MATRIX_SDK_FILENAME: ${{ matrix.sdk_filename }}
steps:
- name: install host build deps
run: |
sudo apt-get update
sudo apt-get -y install libc6-dev libc6-dev-i386
- uses: actions/checkout@v3
- name: Get the SDK
run: |
mkdir sdk
cd sdk
wget "${{ matrix.sdk_url }}"
tar xf "${MATRIX_SDK_FILENAME}"
- name: Set up package dir and signing key
run: |
cd "sdk/${MATRIX_SDK_FILENAME%.tar.xz}"
# for f in ${GITHUB_WORKSPACE}/package/* ; do ln -s $f package/ ; done
# ln -s "${GITHUB_WORKSPACE}"/Makefile package/${{ env.owrt-package }}/
# ln -s "${GITHUB_WORKSPACE}"/files package/${{ env.owrt-package }}/
echo 'untrusted comment: usign key for PowerDNS OpenWrt package feeds' > key-build
echo '${{ secrets.USIGN_KEY }}' >> key-build
- name: Add SDK bins to path
run: |
cd "sdk/${MATRIX_SDK_FILENAME%.tar.xz}"
echo "${GITHUB_WORKSPACE}"/sdk/"${MATRIX_SDK_FILENAME%.tar.xz}"/staging_dir/host/bin >> "$GITHUB_PATH"
echo "${GITHUB_WORKSPACE}"/sdk/"${MATRIX_SDK_FILENAME%.tar.xz}"/staging_dir/toolchain-*/bin >> "$GITHUB_PATH"
- name: Update packages feed
run: |
cd "sdk/${MATRIX_SDK_FILENAME%.tar.xz}"
( echo "src-link dnsdist ${GITHUB_WORKSPACE}/package" ; cat feeds.conf.default ) > feeds.conf
scripts/feeds update packages >/dev/null
scripts/feeds update base >/dev/null
scripts/feeds update dnsdist >/dev/null
- name: Build package
run: |
set -x
cd "sdk/${MATRIX_SDK_FILENAME%.tar.xz}"
for pkg in ${{ env.pkgs }} ; do scripts/feeds install -f $pkg ; done
cat ${GITHUB_WORKSPACE}/default-dot-config >> .config
make defconfig
for pkg in ${{ env.pkgs }} ; do make -j$(nproc) V=s package/$pkg/compile ; done
make -j1 V=s package/index
- name: Prepare artifact
run: |
mkdir -p OpenWrt_${{ matrix.major }}/${{ matrix.arch }}
find sdk/"${MATRIX_SDK_FILENAME%.tar.xz}"/bin/packages/${{ matrix.arch }} -ls
rsync -av sdk/"${MATRIX_SDK_FILENAME%.tar.xz}"/bin/packages/${{ matrix.arch }}/dnsdist OpenWrt_${{ matrix.major }}/${{ matrix.arch }}
tar cf OpenWrt_${{ matrix.major }}-${{ matrix.arch }}.tar OpenWrt_${{ matrix.major }}
- uses: actions/upload-artifact@v3
with:
name: OpenWrt_${{ matrix.major }}-${{ matrix.arch }}
path: OpenWrt_${{ matrix.major }}-${{ matrix.arch }}.tar
deploy:
name: Deploy Packages
runs-on: ubuntu-latest
if: success() || failure() # this tolerates partial failure of build-packages, such as a few targets failing. It feels dangerous though.
needs: build-packages
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
- name: Flush existing files
run: rm -rf OpenWrt_*
# Without any parameters, download-artifact grabs everything, which is what we want
- uses: actions/download-artifact@v3
- name: Extract artifacts
run: |
for tarball in OpenWrt_*-*/*.tar; do
tar xf ${tarball}
rm ${tarball}
done
find -type d -empty -delete
- name: Set up virtualenv
run: |
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
- name: Generate READMEs
run: |
source venv/bin/activate
./generate.py repo_owner=${{ env.repo-owner }} repo_name=${{ env.repo-name }} owrt_package=${{ env.owrt-package }} repo_url=${{ env.repo-url }} run_number=${GITHUB_RUN_NUMBER}
- name: Clean up virtualenv
run: rm -rf venv
- name: Configure git
run: |
git config user.name "${{ env.git-author-name }}"
git config user.email "${{ env.git-author-email }}"
- name: Commit
run: |
git add -A
git commit -m "Deploy GH Actions build ${GITHUB_RUN_NUMBER} to gh-pages"
git push
- name: Change URL to repo.powerdns.com
run: |
echo url: https://repo.powerdns.com >> _config.yml
echo baseurl: /openwrt >> _config.yml
- name: Build for repo.powerdns.com
uses: actions/jekyll-build-pages@v1
with:
source: .
destination: ./_site
future: false
- name: Prepare artifact for repo.powerdns.com
uses: actions/upload-artifact@v3
with:
path: ./_site
name: site-for-repo
retention-days: 7
deploy-repo:
name: Deploy Packages to repo.powerdns.com
runs-on: ubuntu-latest
needs: deploy
steps:
- uses: actions/download-artifact@v3
with:
name: site-for-repo
- run: find . -ls