Skip to content

Commit d6b5627

Browse files
author
Rodrigo Almeida
authored
Add release Actions workflow (#449)
* Uncomment tox * Update job name to test * Add release workflow only on main and with tag
1 parent 39c98f0 commit d6b5627

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release Python package
2+
3+
on:
4+
workflow_run:
5+
workflows: [tests]
6+
branches: [main]
7+
types: [completed]
8+
9+
jobs:
10+
release:
11+
needs: test
12+
runs-on: ubuntu-latest
13+
name: Release package to PyPi
14+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Set up Python 3.8
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.8
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install tox tox-gh-actions
25+
- name: Build and release 📦 to PyPI
26+
with:
27+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
28+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
29+
run: |
30+
tox -e release
31+

.github/workflows/tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
- push
55

66
jobs:
7-
build:
7+
test:
88
runs-on: ubuntu-latest
99
name: Docker | GDAL=${{ matrix.gdal-version }} | python=${{ matrix.python-version }}
1010
container: osgeo/gdal:ubuntu-small-${{ matrix.gdal-version }}
@@ -45,9 +45,10 @@ jobs:
4545
python -m pip install tox
4646
- name: Lint with tox
4747
run: tox -e lint
48-
# - name: Format with tox
49-
# run: tox -e format
48+
- name: Format with tox
49+
run: tox -e format
5050
- name: Flake8 with tox
5151
run: tox -e flake8
5252
- name: Test with tox
5353
run: tox -e test
54+

0 commit comments

Comments
 (0)