-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.78 KB
/
publish.yaml
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
# Publishes to PyPI when a commit tagged with v** is pushed to main
name: Publish to Artifactory
on:
push:
branches:
- main
paths:
- version.toml
# need to grab org secrets for artifactory publish
env:
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
# run artifactory releases on self-hosted runner, change when using pypi
jobs:
publish:
name: Publish
runs-on: [self-hosted, build]
environment: release
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
# We need twine as a dependency below for artifactory releases, remove when using pypi
# importlib 8.0.0 is broken, we should be able to un-pin this once 8.0.1 is released
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
pip install importlib_metadata==7.2.1
- name: Build Package
run: |
python -m build
# disabling publish to pypi, replacing with artifactory for now
# replace this when we want to publish to pypi instead
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
- name: Publish to Artifactory
env:
TWINE_USERNAME: ${{ secrets.ARTIFACTORY_USER }}
TWINE_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
TWINE_NON_INTERACTIVE: true
run: twine upload --verbose --repository-url='https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-release-local' dist/*