Update contracts #360
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: Update contracts | |
on: | |
schedule: | |
# Runs at 05:00 UTC every day | |
- cron: "0 5 * * *" | |
workflow_dispatch: | |
inputs: | |
input1: | |
description: "Update all contracts." | |
required: false | |
permissions: write-all | |
jobs: | |
update_contract: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get version | |
id: versions_step | |
run: | | |
version_tag=$(bash ./.github/scripts/get_release.sh) | |
echo "::set-output name=version_tag::$version_tag" | |
echo "Output from get_release script: $version_tag" | |
- name: Update Aztec contracts | |
run: sudo chown $USER ./tutorials ./workshops && bash ./.github/scripts/update_aztec_contracts.sh ${{ steps.versions_step.outputs.version_tag }} | |
- name: Update L1 contracts | |
run: bash ./.github/scripts/update_l1_contracts.sh | |
- name: Remove tmp directory | |
run: rm -rf tmp | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "helloworld@mcgee.cat" | |
git config --global user.name "catmcgee" | |
git add . | |
git commit -m "Github Action: Update contract" -a || echo "No changes to commit" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |