This repository has been archived by the owner on May 30, 2024. It is now read-only.
forked from stevencox/tycho
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (47 loc) · 1.64 KB
/
pypi-dev-upload.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
# This workflow will create an image for any tycho development taking place, not in master branch.
# We use the {{ github.ref_name }} ie branch name and date to ensure uniqueness of the package.
name: upload-dev-pypi
run-name: Package and Upload develop image to Pypi
on:
push:
branches-ignore:
- master
- main
paths-ignore:
- README.md
- .old_cicd/*
- .github/*
- .github/workflows/*
- LICENSE
- .gitignore
- .dockerignore
- .githooks
jobs:
build-dev-to-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Package Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m pip install --upgrade twine
# Important, this does not change the current version of __init__.py in the
# Github repo itself, only updates within container for the specific run.
- name: Edit __init__.py version for develop release
run: |
R_VERSION=$(grep VERSION ./tycho/__init__.py | awk '{ print $3 }' | tr -d '"')
date=$(date '+%Y%m%d%H%M%S')
BRANCH=$(echo ${{ github.ref_name}} | sed 's/[_-]//g')
DEV_VERSION=${R_VERSION}.dev${date}
echo VERSION=\"$DEV_VERSION\" > ./tycho/__init__.py
- name: Build Package
run: python -m build
- name: Publish Package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}