Skip to content

Commit 8de75ec

Browse files
committed
Merge branch 'master' into feature/drop-python-2
2 parents 5c34b84 + 52156b2 commit 8de75ec

2 files changed

Lines changed: 56 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Deploy and Release
22

33
# Controls when the workflow will run
44
on:
5-
# Triggers the workflow on tag push
5+
# Triggers the workflow on version change
66
push:
7-
tags:
8-
- "v*"
7+
paths:
8+
- "dpath/version.py"
99

1010
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1111
jobs:
@@ -19,6 +19,32 @@ jobs:
1919
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2020
- uses: actions/checkout@v2
2121

22+
- name: Get Version
23+
id: get-version
24+
run: |
25+
python -c "from dpath.version import VERSION; print(f'::set-output name=version::v{VERSION}');"
26+
27+
- name: Check Tag
28+
uses: mukunku/tag-exists-action@v1.0.0
29+
id: check-tag
30+
with:
31+
tag: ${{ steps.get-version.outputs.version }}
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Create Tag
36+
if: ${{ steps.check-tag.outputs.exists }} == "false"
37+
uses: negz/create-tag@v1
38+
with:
39+
version: ${{ steps.get-version.outputs.version }}
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Generate Changelog
43+
id: generate-changelog
44+
uses: loopwerk/tag-changelog@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
2248
- name: PyPI Deployment
2349
uses: casperdcl/deploy-pypi@v2
2450
with:
@@ -30,8 +56,10 @@ jobs:
3056
build: clean sdist -d dist/
3157
# `pip` command to run ("true" is a shortcut for "wheel -w <dist_dir> --no-deps .")
3258
pip: true
33-
59+
3460
- name: Github Release
3561
uses: softprops/action-gh-release@v1
3662
with:
63+
tag_name: ${{ steps.get-version.outputs.version }}
64+
body: ${{ steps.generate-changelog.outputs.changes }}
3765
files: dist/*

MAINTAINERS.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ We name bugfixes as "bugfix/ISSUENUMBER_shortname"; features are named "feature/
8787
Cutting a New Release
8888
=====================
8989

90-
Releases for dpath occur automatically from travis-ci based on tags on the master branch, or on the version/[0-9].x branches for major version LTS.
90+
Releases for dpath occur automatically from Github Actions based on version changes on the master branch.
91+
92+
Due to legacy reasons older tag names do not follow a uniform format:
9193

9294
akesterson@akesterson:~/dpath-python$ git tag
9395
1.0-0
@@ -108,18 +110,33 @@ Releases for dpath occur automatically from travis-ci based on tags on the maste
108110
build,1.5,0
109111
build,2.0,0
110112

111-
Once upon a time, the version string was automatially computed based on the content of these tags. Now, however, the version string is stored statically in dpath/version.py
113+
Moving forward version numbers and tag names will be identical and follow the standard semver format.
114+
115+
The version string is stored in `dpath/version.py` and tag names/release versions are generated using this string.
112116

113117
akesterson@akesterson:~/dpath-python$ cat dpath/version.py
114118
VERSION = "2.0.0"
115119

116120
To cut a new release, follow this procedure:
117121

118-
1. Commit a new dpath/version.py on the appropriate branch with the format "MAJOR.MINOR.RELEASE"
119-
2. Add a new tag of the form "build,MAJOR.MINOR,RELEASE" to the appropriate branch. This tag must have the same version number as the one commmited in dpath/version.py or we will fill your desk drawers with cockroaches.
120-
3. Push the new branch version and the associated tag to github.
121-
4. travis-ci SHOULD push the new release to pypi.
122+
1. Commit a new `dpath/version.py` on the appropriate branch with the format "MAJOR.MINOR.RELEASE".
123+
2. Github Actions SHOULD push the new release to PyPI on merge to `master`.
124+
125+
See `.github/workflows/deploy.yml` for more information.
122126

123-
If travis-ci fails to update pypi, follow the instructions on manually creating a release, here:
127+
If the Github workflow fails to update pypi, follow the instructions on manually creating a release, here:
124128

125129
https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
130+
131+
Deployment CI was previously implemented using [Travis CI](https://travis-ci.org/github/akesterson/dpath-python).
132+
133+
Running Tests
134+
=============
135+
136+
Tests are managed using [tox](https://tox.readthedocs.io/en/latest/).
137+
138+
Environment creation and dependency installation is managed by this tool, all one has to do is install it with `pip` and run `tox` in this repo's root directory.
139+
140+
Tests can also be run with Github Actions via the [tests.yml](https://github.com/dpath-maintainers/dpath-python/actions/workflows/tests.yml) workflow.
141+
142+
This workflow will run automatically on pretty much any commit to any branch of this repo but manual runs are also available.

0 commit comments

Comments
 (0)