-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.55 KB
/
publish-replicate-models.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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: '21'
- 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