Skip to content

Commit 91f5f75

Browse files
committed
chore: add a release workflow
1 parent e33b3cb commit 91f5f75

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI/CD
1+
name: CI
22

33
on:
44
push:

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9].[0-9].[0-9]'
7+
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
python-version: [3.8]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip setuptools wheel
26+
python -m pip install tox tox-gh-actions twine
27+
- name: Test with tox
28+
run: tox
29+
env:
30+
STRUCTURIZR_WORKSPACE_ID: ${{ secrets.STRUCTURIZR_WORKSPACE_ID }}
31+
STRUCTURIZR_API_KEY: ${{ secrets.STRUCTURIZR_API_KEY }}
32+
STRUCTURIZR_API_SECRET: ${{ secrets.STRUCTURIZR_API_SECRET }}
33+
- name: Build package
34+
run: python setup.py sdist bdist_wheel
35+
- name: Check the package
36+
run: twine check dist/*
37+
- name: Publish to PyPI
38+
env:
39+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
40+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
41+
run:
42+
twine upload --skip-existing --non-interactive dist/*
43+
- name: Create GitHub release
44+
uses: actions/create-release@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
tag_name: ${{ github.ref }}
49+
release_name: ${{ github.ref }}
50+
body: >
51+
Please see
52+
https://github.com/${{ github.repository }}/blob/${GITHUB_REF#refs/heads/}/CHANGELOG.rst
53+
for the full release notes.
54+
draft: false
55+
prerelease: false

0 commit comments

Comments
 (0)