-
Notifications
You must be signed in to change notification settings - Fork 33
69 lines (64 loc) · 2.23 KB
/
release.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
66
67
68
69
name: PyPi release
on:
push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: '1.5.1'
- name: Install dependencies
run: |
poetry install
- name: build
run: |
poetry build
- name: Get version
id: get-version
run: |
echo "::set-output name=current_version::$(poetry version | awk '{print $2}')"
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
outputs:
publishedVersion: ${{ steps.get-version.outputs.current_version }}
verify:
needs: release
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
os: [ ubuntu-22.04, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install with pip
shell: bash
run: |
python -m pip install --upgrade pip
# Retry 3 times before the steps actually fails because sometimes it takes a minute for pip to recognize the new version
(echo "pip Install Attempt: 1" && pip install --force podaac-data-subscriber==${{ needs.release.outputs.publishedVersion }}) || \
(echo "pip Install Attempt: 2" && pip install --force podaac-data-subscriber==${{ needs.release.outputs.publishedVersion }}) || \
(echo "pip Install Attempt: 3" && pip install --force podaac-data-subscriber==${{ needs.release.outputs.publishedVersion }}) || \
(echo "pip Install Step Failed" && exit 1)
- name: Print Subscriber Usage
run: |
podaac-data-subscriber -h
- name: Print Downloader Usage
run: |
podaac-data-downloader -h