Skip to content

Update licenses

Update licenses #13

# Workflow to update licenses for x86 Linux and MacOS
# Support ARM MacOS
# FIXME: https://github.com/zama-ai/concrete-ml-internal/issues/3925
name: Update licenses
on:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
jobs:
update_licenses:
strategy:
matrix:
# No arm-macos machines on github runners
# we would need to use one of our own runners
os: [ubuntu-20.04, macos-latest-xl]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
PIP_INDEX_URL: ${{ secrets.PIP_INDEX_URL }}
PIP_EXTRA_INDEX_URL: ${{ secrets.PIP_EXTRA_INDEX_URL }}
steps:
# Mask internal URLs if logged
- name: Add masks
id: masks
run: |
echo "::add-mask::${{ secrets.INTERNAL_PYPI_URL_FOR_MASK }}"
echo "::add-mask::${{ secrets.INTERNAL_REPO_URL_FOR_MASK }}"
# Checkout repository
- name: Checkout Code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Set up Python 3.8
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry==1.2.2
make setup_env
- name: Update licenses
run: |
make licenses
# Pull the latest changes if there are some
- name: Pull latest changes
run: |
git pull -X theirs
# If the target branch is main or a release branch, a pull request is opened for everyone to
# review
- name: Open PR
if: ${{ github.ref_name == 'main' || startsWith(github.ref_name , 'release/') }}
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666
with:
token: ${{ secrets.BOT_TOKEN }}
commit-message: "chore: update licenses ${{ matrix.os }}"
branch: "chore/update_licenses_${{ matrix.os }}"
base: "${{ github.ref_name }}"
title: "Update licenses for ${{ matrix.os }} on ${{ github.ref_name }}"
body: "Update licenses for ${{ matrix.os }} on ${{ github.ref_name }}"
# If the target branch is another branch, the current branch is automatically merged into it
- name: Push changes into the current branch
if: ${{ github.ref_name != 'main' && !(startsWith(github.ref_name , 'release/')) }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: refresh ${{ github.event.inputs.notebook }} notebook"
add_options: '-u'