Skip to content

Update licenses

Update licenses #44

# 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@b4ffde65f46336ab88eb53be808477a3936bae11
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Set up Python 3.8
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
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@v5
with:
commit_message: "chore: update licenses for ${{ matrix.os }}"
add_options: '-u'