forked from RadioAstronomySoftwareGroup/pyuvdata
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.8 KB
/
publish-to-test-pypi.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
name: Publish Python distributions to PyPI and TestPyPI
on: [push, pull_request]
jobs:
build-n-publish:
name: Build and publish to PyPI and TestPyPI
runs-on: ubuntu-latest
env:
ENV_NAME: pyuvdata_publish
PYTHON: 3.7
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Get Miniconda Linux
run: |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/miniconda.sh;
bash $HOME/miniconda.sh -b -p $HOME/miniconda
- name: Setup paths
shell: bash
run: |
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
echo "$HOME/miniconda/envs/test/bin" >> $GITHUB_PATH
- name: Setup Environment
run: ./ci/install_conda.sh
- name: Create environment variable
if: startsWith(github.ref, 'refs/tags/') != true
shell: bash
run: |
wget https://gist.github.com/plaplant/0902f09e59166bac742bbd554f3cd2f9/raw/make_dev_version.sh
source activate $ENV_NAME
version=$(bash make_dev_version.sh)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$version" >> $GITHUB_ENV
- name: Check environment variable
run: echo $SETUPTOOLS_SCM_PRETEND_VERSION
- name: Build a binary wheel and a source tarball
shell: bash
run: |
source activate $ENV_NAME
python -m pep517.build --source --out-dir dist/ .
- name: Publish to Test PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}