Generate Replicate Maven Modules #3
Workflow file for this run
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: Generate Replicate Maven Modules | |
on: | |
release: | |
types: [ created ] | |
jobs: | |
generate-modules: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [ | |
{ name: "llama3", models: "meta/meta-llama-3-8b-instruct,meta/meta-llama-3-70b-instruct" }, | |
{ name: "flux", models: "black-forest-labs/flux-schnell" } | |
] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r replicate-tools/requirements.txt | |
- name: Run replicate-tools to download JSON schemas | |
env: | |
REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_API_TOKEN }} | |
REPLICATE_MODELS: ${{ matrix.version.models }} | |
run: | | |
cd replicate-tools | |
python download_replicate_schemas.py | |
- name: Run Maven to generate Java models | |
run: | | |
cd replicate-models | |
mvn clean install | |
- name: Deploy Maven artifact to GitHub Packages | |
env: | |
VERSION: ${{ github.event.release.tag_name }}-${{ matrix.version.name }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd replicate-models | |
mvn versions:set -DnewVersion=$VERSION | |
mvn deploy |