85 lines
2.8 KiB
YAML
85 lines
2.8 KiB
YAML
# Daily uploads package snapshots to https://github.com/mlflow/mlflow/releases/tag/nightly.
|
|
name: snapshots
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *" # Runs daily at midnight UTC
|
|
workflow_dispatch: # Allows manual triggering
|
|
pull_request: # To test updates
|
|
paths:
|
|
- ".github/workflows/snapshots.yml"
|
|
- ".github/workflows/snapshots.js"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository == 'mlflow/mlflow'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
permissions:
|
|
contents: write # Needed to create/update releases and manage assets
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
- uses: ./.github/actions/setup-python
|
|
- uses: ./.github/actions/setup-java
|
|
- uses: r-lib/actions/setup-r@a51a8012b0aab7c32ef9d19bf54da93f3254335e # v2.12.0
|
|
|
|
- name: Create artifacts directory
|
|
run: |
|
|
ARTIFACT_DIR=$(mktemp -d)
|
|
echo "ARTIFACT_DIR=$ARTIFACT_DIR" >> $GITHUB_ENV
|
|
|
|
- name: Build Python packages
|
|
id: build-dist
|
|
run: |
|
|
uv pip install --system build
|
|
python dev/build.py
|
|
find $PWD/dist -type f -name "*.whl" -exec cp {} $ARTIFACT_DIR/ \;
|
|
python dev/build.py --package-type skinny
|
|
find $PWD/dist -type f -name "*.whl" -exec cp {} $ARTIFACT_DIR/ \;
|
|
ls $ARTIFACT_DIR
|
|
|
|
- name: Build R package
|
|
working-directory: mlflow/R/mlflow
|
|
run: |
|
|
Rscript -e 'install.packages("devtools")'
|
|
Rscript -e 'devtools::build(path = ".")'
|
|
find $PWD -name "*.tar.gz" -type f -exec cp {} $ARTIFACT_DIR/ \;
|
|
ls $ARTIFACT_DIR
|
|
|
|
- name: Build Java packages
|
|
working-directory: mlflow/java
|
|
run: |
|
|
mvn -B -DskipTests clean package
|
|
find $PWD -path "*/target/*.jar" \
|
|
! -name "*sources.jar" \
|
|
! -name "*javadoc.jar" \
|
|
! -name "original-*.jar" \
|
|
-exec cp {} $ARTIFACT_DIR/ \;
|
|
ls $ARTIFACT_DIR
|
|
|
|
- name: Upload artifacts to nightly release
|
|
# This step requires contents write permission, but pull requests filed from forks do not have this permission.
|
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'mlflow/mlflow'
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
with:
|
|
retries: 3
|
|
script: |
|
|
const { uploadSnapshots } = require('./.github/workflows/snapshots.js');
|
|
await uploadSnapshots({
|
|
github,
|
|
context,
|
|
artifactDir: process.env.ARTIFACT_DIR
|
|
});
|