Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Commit 6b28e32

Browse files
committed
Update workflows.
1 parent 1d07b2d commit 6b28e32

4 files changed

Lines changed: 70 additions & 30 deletions

File tree

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: [
17+
2.7,
18+
3.5,
19+
3.6,
20+
3.7,
21+
3.8,
22+
]
23+
steps:
24+
- uses: actions/checkout@v1
25+
- uses: actions/setup-python@v1
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
32+
- name: Lint with flake8
33+
run: |
34+
pip install flake8
35+
flake8 webthing --count --max-line-length=79 --statistics
36+
- name: Test with pytest
37+
run: |
38+
./test.sh

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.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
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.8
16+
- name: Set env
17+
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11})
18+
- name: Create Release
19+
id: create_release
20+
uses: actions/create-release@v1.0.0
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: Release ${{ env.RELEASE_VERSION }}
26+
draft: false
27+
prerelease: false
28+
- name: Publish to PyPI
29+
run: |
30+
./package.sh
31+
twine upload --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} dist/*

package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/bash -e
22

33
rm -rf build/ dist/
44

0 commit comments

Comments
 (0)