Skip to content

Commit ed84f57

Browse files
authored
ci: add release workflow and instructions (#3)
1 parent 4f826d2 commit ed84f57

File tree

7 files changed

+93
-36
lines changed

7 files changed

+93
-36
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ jobs:
99
tests:
1010
name: Format and Tests
1111
runs-on: "${{ matrix.os }}"
12-
continue-on-error: ${{ matrix.experimental }}
1312
strategy:
1413
fail-fast: false
1514
matrix:
1615
os: [ubuntu-latest, windows-latest, macos-latest]
1716
python-version: ['3.7', '3.8', '3.9', '3.10']
18-
experimental: [false]
1917
include:
2018
- os: ubuntu-latest
2119
- os: windows-latest
@@ -37,36 +35,10 @@ jobs:
3735
shell: bash
3836
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3937

40-
- name: Bootstrap poetry
41-
shell: bash
42-
run: |
43-
curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py \
44-
| python - -y ${{ matrix.bootstrap-args }}
45-
- name: Update PATH
46-
if: ${{ matrix.os != 'windows-latest' }}
47-
shell: bash
48-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
49-
50-
- name: Update Path for Windows
51-
if: ${{ matrix.os == 'windows-latest' }}
52-
shell: bash
53-
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
54-
55-
- name: Configure poetry
56-
shell: bash
57-
run: poetry config virtualenvs.in-project true
58-
59-
- name: Set up cache
60-
uses: actions/cache@v2
61-
id: cache
62-
with:
63-
path: .venv
64-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
65-
66-
- name: Ensure cache is healthy
67-
if: steps.cache.outputs.cache-hit == 'true'
68-
shell: bash
69-
run: timeout 10s poetry run pip --version || rm -rf .venv
38+
- name: Install poetry
39+
run: |
40+
pip install --upgrade pip
41+
pip install --upgrade poetry
7042
7143
- name: Install dependencies
7244
shell: bash
@@ -80,7 +52,7 @@ jobs:
8052
shell: bash
8153
run: poetry run lint
8254

83-
- name: Lint
55+
- name: Type Check
8456
shell: bash
8557
run: poetry run type-check
8658

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [published] # Trigger when release is created
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
12+
- name: Set up Python 3.7
13+
uses: actions/setup-python@3105fb18c05ddd93efea5f9e0bef7a03a6e9e7df
14+
with:
15+
python-version: 3.7
16+
- name: Install dependencies
17+
run: |
18+
pip install --upgrade pip
19+
pip install --upgrade poetry
20+
- name: Publish with Poetry
21+
run: |
22+
poetry config repositories.pypi "https://pypi.org/legacy/"
23+
poetry config pypi-token.pypi $PYPI_TOKEN
24+
poetry publish --build
25+
env:
26+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Version - Date
2+
(e.g v0.0.1 - 19 Nov 2021)
3+
------------
4+
5+
Bug fixes:
6+
7+
* [#PR number](PR or issue link) description.
8+
9+
Features:
10+
11+
* [#PR number](PR or issue link) description.
12+
13+
Other changes:
14+
15+
* [#PR number](PR or issue link) description.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ Install pyenv [here]https://github.com/pyenv/pyenv#installation)
132132
Install and set python version with pyenv:
133133
134134
```console
135-
pyenv install 3.7.8
136-
pyenv local 3.7.8
135+
pyenv install 3.9.9
136+
pyenv local 3.9.9
137137
```
138138
139-
Note: You are welcome to use any python version >= 3.7.1
139+
Note: You are welcome to use any python version between 3.7.1 and 3.10
140140

141141
To validate that your poetry venv is using the correct python version
142142

RELEASE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Issuing a New Release
2+
3+
The maintainers are able to issue a new release. The steps to publish release is a handful of manual steps since we want to ensure that issuing a release is a very conscious decision, requiring peer review, and cannot easily happen accidentally. There are main two steps to publish a new release:
4+
5+
## 1. Create a Release PR
6+
7+
* Create a new branch locally for the release, for example:
8+
9+
```
10+
git checkout -b releases/v0.1.0
11+
```
12+
13+
* Tell Poetry to bump the version:
14+
```
15+
poetry version [patch|minor|major]
16+
```
17+
Note: This command is updating the version number in the pyproject.toml. You can totally do this manually. Helpful docs: [Poetry version command](https://python-poetry.org/docs/cli/#version), [Semantic Versioning](https://semver.org/)
18+
19+
* Update the [CHANGELOG](CHANGELOG.md) with the appropriate new version number and release date with the clear description
20+
21+
* Create a pull request for these changes, and get it approved
22+
23+
## 2. Create a new release from Github Page
24+
25+
Once your PR has been merged, the final piece is to actually create the new release.
26+
27+
1. Go to the [sample-size releases page](https://github.com/godaddy/sample-size/releases) and click on `Create a new release`.
28+
29+
1. Enter an appropriate tag version or create a new tag. Please prefix the version names with the letter `v`
30+
31+
![release-tag](./docs/source/_static/release-tag.png)
32+
33+
34+
1. Title the release. Generally these would just be in the form `Sample-Size 0.1.0`
35+
36+
1. Copy-paste the CHANGELOG entries for this new version into the description.
37+
38+
1. Click `Publish release`!
39+
40+
1. The publish workflow will be triggered automatically to release it to [PyPI](https://pypi.org/) for the new version!

docs/source/_static/release-tag.png

115 KB
Loading

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name = "sample-size"
33
version = "0.0.1a1"
44
description = "A python module implementing power analysis to estimate sample size"
55
authors = []
6+
include = ["CHANGELOG.md", "README.md"]
7+
readme = "README.md"
8+
maintainers = ["GoDaddy <[email protected]>"]
9+
keywords = ["sample size", "experimentation", "power analysis"]
610

711
[tool.poetry.dependencies]
812
python = ">=3.7.1,<3.11"

0 commit comments

Comments
 (0)