Skip to content

update GH actions to use poetry 1.x #320

update GH actions to use poetry 1.x

update GH actions to use poetry 1.x #320

name: Regenerate Alliance Schema Model Artifacts
on:
pull_request:
types: [synchronize, opened, reopened]
branches:
- main
jobs:
generate-artifacts:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python Environment
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
- name: Setup build environment
run: |
sudo apt update
sudo apt install -y graphviz
wget https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-1.0.2/jsonschema2pojo-1.0.2.tar.gz
tar -xvzf jsonschema2pojo-1.0.2.tar.gz
#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry 1.x
run: pipx install poetry==1.*
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install poetry dependencies
run: poetry install --no-interaction --no-root
- name: Generate AGR Curation Model artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PATH=$PATH:`pwd`/jsonschema2pojo-1.0.2/bin
make clean-artifacts
make -B gen-artifacts
- name: Commit and push artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
if [[ $(git add -n generated/) ]]; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add generated/
git commit -m "Automated artifacts regeneration [skip actions]"
git push
else
echo "No artifact changes to commit."
fi