Skip to content

Update licenses

Update licenses #72

# 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 }}-${{ github.event_name }}-${{ github.workflow }}"
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@9bb56186c3b09b4f86b1c65136769dd318469633
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Set up Python 3.8
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry==1.7.1
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@70a41aba780001da0a30141984ae2a0c95d8704e
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@v5
with:
commit_message: "chore: update licenses for ${{ matrix.os }}"
add_options: '-u'