-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (45 loc) · 1.39 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
release-pyiamvortex-job:
runs-on: ubuntu-latest
name: Release pyiamvortex
env:
VERSION: 0.0.0
steps:
- name: Set Env
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools packaging twine build --upgrade
pip install -r requirements-dev.txt
- name: Verify Tag does not exist
run: |
! git rev-parse ${{ env.VERSION }} || { echo "Ensure that no tag exists for ${{ env.VERSION }}" ; exit 1; }
- name: Verify supplied version exists in the CHANGELOG
run: |
grep ${{ env.VERSION }} CHANGELOG.md || { echo "Ensure that the CHANGELOG contains an entry for ${{ env.VERSION }}" ; exit 1; }
- name: Build Python
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Tag version on Github
run: |
git tag ${{ env.VERSION }}
git push origin ${{ env.VERSION }}