CD Check NLnet Labs Unbound Release #2
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: CD Check NLnet Labs Unbound Release | |
on: | |
schedule: | |
- cron: '0 19 * * mon-fri' | |
jobs: | |
unbound-update: | |
runs-on: ubuntu-latest | |
env: | |
CD_COMMIT_MESSAGE: Continuous Delivery Build Variables | |
CD_COMMIT_AUTHOR: Continuous Delivery | |
steps: | |
- name: Get versions | |
id: GET_VERSIONS | |
run: | | |
echo UNBOUND_VERSION="$(curl -s https://api.github.com/repos/NLnetLabs/unbound/releases | jq '.[0] | .name' -r | grep -Eo '([0-9]+)(\.?[0-9]+)*' | head -1)" >> $GITHUB_OUTPUT | |
echo UNBOUND_DOCKER_VERSION="$(curl -s https://api.github.com/repos/madnuttah/unbound-docker/releases | jq '.[0] | .name' -r | grep -Eo '([0-9]+)(\.?[0-9]+)*' | head -1)" >> $GITHUB_OUTPUT | |
echo UNBOUND_DOCKER_IMAGE_VERSION="$(curl -s https://api.github.com/repos/madnuttah/unbound-docker/releases | jq '.[0] | .name' -r)" >> $GITHUB_OUTPUT | |
- name: Is update available | |
id: IS_UPDATE_AVAILABLE | |
run: | | |
if [[ "${{ steps.GET_VERSIONS.outputs.UNBOUND_VERSION }}" == "${{ steps.GET_VERSIONS.outputs.UNBOUND_DOCKER_VERSION }}" ]]; then | |
echo "No update found" | |
exit 1 | |
else | |
echo "Update found" | |
echo IMAGE_BUILD_DATE="$(date -u)" >> $GITHUB_OUTPUT | |
echo UNBOUND_SHA256="$(curl -s https://nlnetlabs.nl/downloads/unbound/unbound-"${{ steps.GET_VERSIONS.outputs.UNBOUND_VERSION }}".tar.gz.sha256)" 2>/dev/null >> $GITHUB_OUTPUT | |
fi | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Push buildvars to repository | |
run: | | |
UNBOUND_VERSION=${{ steps.GET_VERSIONS.outputs.UNBOUND_VERSION }} | |
echo UNBOUND_VERSION=$UNBOUND_VERSION > buildvars | |
echo UNBOUND_DOCKER_IMAGE_VERSION="${UNBOUND_VERSION}-0" >> buildvars | |
echo UNBOUND_SHA256=${{ steps.IS_UPDATE_AVAILABLE.outputs.UNBOUND_SHA256 }} >> buildvars | |
echo IMAGE_BUILD_DATE=${{ steps.IS_UPDATE_AVAILABLE.outputs.IMAGE_BUILD_DATE }} >> buildvars | |
git config --global user.name "${{ env.CD_COMMIT_AUTHOR }}" | |
git config --global user.email "96331755+madnuttah@users.noreply.github.com" | |
git add buildvars | |
git commit buildvars -m "${{ env.CD_COMMIT_MESSAGE }}" | |
git push origin main | |
exit 0 |