Skip to content

Bump actions/upload-artifact from 6 to 7 #478

Bump actions/upload-artifact from 6 to 7

Bump actions/upload-artifact from 6 to 7 #478

Workflow file for this run

name: Builds and publishes the fiftyone-db package
on:
push:
tags:
- db-v[0-9]+.[0-9]+.[0-9]+
- db-v[0-9]+.[0-9]+.[0-9]+rc[0-9]+
pull_request:
paths:
- package/db/**
- .github/workflows/build-db.yml
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- sdist
- darwin-arm64
- darwin-x86_64
- windows-32
- windows-x86_64
steps:
- name: Clone fiftyone
uses: actions/checkout@v6
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel build
- name: Set environment
env:
RELEASE_TAG: ${{ github.ref }}
run: |
if [[ $RELEASE_TAG =~ ^refs\/tags\/db-v[0-9]+.[0-9]+.[0-9]+rc[0-9]+ ]]; then
echo "RELEASE_VERSION=$(echo "${{ github.ref }}" | sed "s/^refs\/tags\/db-v//")" >> $GITHUB_ENV
fi
- name: Build Darwin arm64 wheel
if: ${{ matrix.platform == 'darwin-arm64' }}
run: |
cd package/db
FODB_MACHINE=arm64 FODB_SYSTEM=Darwin python -Im build
- name: Build Darwin x86_64 wheel
if: ${{ matrix.platform == 'darwin-x86_64' }}
run: |
cd package/db
FODB_MACHINE=x86_64 FODB_SYSTEM=Darwin python -Im build
- name: Build Windows 32 wheel
if: ${{ matrix.platform == 'windows-32' }}
run: |
cd package/db
FODB_MACHINE=32 FODB_SYSTEM=Windows python -Im build
- name: Build Windows x86_64 wheel
if: ${{ matrix.platform == 'windows-x86_64' }}
run: |
cd package/db
FODB_MACHINE=x86_64 FODB_SYSTEM=Windows python -Im build
- name: Build sdist
if: ${{ matrix.platform == 'sdist' }}
run: |
cd package/db
python -Im build --sdist
- name: Upload
uses: actions/upload-artifact@v7
if: ${{ matrix.platform == 'sdist' }}
with:
name: dist-${{ matrix.platform }}
path: package/db/dist/*.tar.gz
- name: Upload wheel
if: ${{ matrix.platform != 'sdist' }}
uses: actions/upload-artifact@v7
with:
name: dist-${{ matrix.platform }}
path: package/db/dist/*.whl
test:
runs-on: ubuntu-latest
needs: build
env:
FIFTYONE_DO_NOT_TRACK: true
steps:
- name: Clone fiftyone
uses: actions/checkout@v6
- name: Download fiftyone-db
uses: actions/download-artifact@v7
with:
name: dist-sdist
path: downloads
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install fiftyone-db
run: |
pip install downloads/fiftyone_db-*.tar.gz
- name: Install test dependencies
run: |
pip install pytest
- name: Run tests
run: |
cd package/db/
python -m pytest --verbose tests/
publish:
runs-on: ubuntu-latest
needs: [build, test]
if: startsWith(github.ref, 'refs/tags/db-v')
environment: release # For trusted publishing. See below.
permissions:
contents: read
id-token: write
steps:
- name: Download
uses: actions/download-artifact@v7
with:
pattern: dist-*
merge-multiple: true
path: dist
# Utilize
# [trusted publishers](https://docs.pypi.org/trusted-publishers/)
# This will use OIDC to publish the dists/ package to pypi.
# See
# [fiftyone-db](https://pypi.org/manage/project/fiftyone-db/settings/publishing/)
- name: Publish
uses: pypa/[email protected]