Skip to content

didc Update

didc Update #148

Workflow file for this run

# A GitHub Actions workflow that regularly checks for new `didc` releases
# and creates a PR on new versions.
name: didc Update
on:
schedule:
# check for new `didc` releases daily at 7:30
- cron: '30 7 * * *'
workflow_dispatch:
jobs:
didc-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# First, check `didc` releases (on the candid repo) for a new version.
- name: Check new didc version
id: update
run: |
pwd
find .github/actions
current_didc_release=$(jq -r '.defaults.build.config.DIDC_VERSION' dfx.json)
echo "current didc release '$current_didc_release'"
latest_didc_release=$(curl -sSL https://api.github.com/repos/dfinity/candid/releases/latest | jq .tag_name -r)
echo "latest didc release '$latest_didc_release'"
if [ "$current_didc_release" != "$latest_didc_release" ]
then
echo didc needs an update
sudo apt-get update -yy && sudo apt-get install -yy moreutils && command -v sponge
DIDC_RELEASE="$latest_didc_release" jq '.defaults.build.config.DIDC_VERSION=(env.DIDC_RELEASE)' dfx.json | sponge dfx.json
echo "updated=1" >> "$GITHUB_OUTPUT"
echo "version=$latest_didc_release" >> "$GITHUB_OUTPUT"
else
echo "updated=0" >> "$GITHUB_OUTPUT"
fi
jq '.defaults.build.config.DIDC_VERSION' dfx.json
echo "Git status:"
git status
echo "Changes:"
git diff
# If `dfx.json` was updated, create a PR.
- name: Create Pull Request
if: ${{ steps.update.outputs.updated == '1' }}
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GIX_BOT_PAT }}
base: main
# Note: Please be careful when updating the add-paths field. We have had the snsdemo committed by accident, with a pattern that matches nothing seemingly committing everything.
add-paths: dfx.json
commit-message: Update didc release
committer: GitHub <noreply@github.com>
author: gix-bot <gix-bot@users.noreply.github.com>
branch: bot-didc-update
branch-suffix: timestamp
delete-branch: true
title: 'Update didc release to ${{ steps.update.outputs.version }}'
body: |
# Motivation
A newer version of `didc` is available.
# Changes
## Changes made by a bot triggered by ${{ github.actor }}
- Update the version of `didc` specified in `dfx.json`.
## Changes made by a human (delete if inapplicable)
# Tests
- CI contains tests that detect most breaking changes in `didc`.
- [ ] Please check [the didc release notes](https://github.com/dfinity/candid/releases) (if any).
- [ ] Please check [the didc git history](https://github.com/dfinity/candid/commits/master/tools/didc) (if reasonably short and understandable).
# Since this is a scheduled job, a failure won't be shown on any
# PR status. To notify the team, we send a message to our Slack channel on failure.
- name: Notify Slack on failure
uses: dfinity/internet-identity/.github/actions/slack@release-2023-08-28
if: ${{ failure() }}
with:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MESSAGE: "didc update failed"