-
Notifications
You must be signed in to change notification settings - Fork 557
65 lines (62 loc) · 1.77 KB
/
build-graphql.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
58
59
60
61
62
63
64
65
name: Builds and publishes the fiftyone-graphql package
on:
push:
tags:
- graphql-v*
# pull_request:
# paths:
# - package/graphql/**
# - .github/workflows/build-graphql.yml
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Clone fiftyone
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
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\/v[0-9]+.[0-9]+.[0-9]+rc[0-9]+ ]]; then
echo "RELEASE_VERSION=$(echo "${{ github.ref }}" | sed "s/^refs\/tags\/v//")" >> $GITHUB_ENV
fi
- name: Build wheel
run: |
cd package/graphql
python -Im build
- name: Upload wheel(s)
uses: actions/upload-artifact@v4
with:
name: dist
path: package/graphql/dist/*
publish:
runs-on: ubuntu-20.04
needs: [build]
if: startsWith(github.ref, 'refs/tags/db-v')
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: downloads
- name: Install dependencies
run: |
pip install twine
- name: Set environment
env:
RELEASE_TAG: ${{ github.ref }}
run: |
echo "TWINE_PASSWORD=${{ secrets.FIFTYONE_PYPI_TOKEN }}" >> $GITHUB_ENV
echo "TWINE_REPOSITORY=pypi" >> $GITHUB_ENV
- name: Upload to pypi
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
run: |
python -m twine upload downloads/dist/*