Skip to content

Commit f128e97

Browse files
committed
Merge branch '63-automate-publication' into 'master'
Resolve "Automate publication of NUTS" Closes #63 See merge request ins/nettowel/nettowel-nuts!35
2 parents 83f545e + 95c9805 commit f128e97

3 files changed

Lines changed: 41 additions & 6 deletions

File tree

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2-
name: Publish nuts to PyPI
2+
# https://www.ianwootten.co.uk/2020/10/23/publishing-to-pypi-using-github-actions/
3+
name: Publish nuts to PyPI and release on GitHub
34
on: [push]
4-
jobs:
5-
build-and-publish:
5+
jobs:
6+
build-and-publish-to-pypi:
67
if: startsWith(github.ref, 'refs/tags')
78
name: Build and publish nuts to PyPI
89
runs-on: ubuntu-latest
910
steps:
10-
- uses: actions/checkout@master
11+
- uses: actions/checkout@v2
1112
- name: Set up Python 3.7
12-
uses: actions/setup-python@v1
13+
uses: actions/setup-python@v2
1314
with:
1415
python-version: 3.7
1516
- name: Install poetry
@@ -18,3 +19,19 @@ jobs:
1819
run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_TOKEN }}"
1920
- name: Build and then publish nuts to PyPI
2021
run: poetry publish --build
22+
relase-on-github:
23+
if: startsWith(github.ref, 'refs/tags')
24+
name: Release on GitHub
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Set tag value
29+
id: tag-val
30+
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
31+
- name: Release on Github
32+
uses: softprops/action-gh-release@v1
33+
with:
34+
body_path: release_notes/${{ steps.tag-val.outputs.SOURCE_TAG }}.md
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
GITHUB_REPOSITORY: bytinbit/nuts-test

make-release.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
if [[ $# != 1 ]] ; then
3+
echo "error: please provide a version tag in the form 'v.1.0.0'" >&2
4+
exit 1
5+
fi
6+
7+
FILE=release_notes/$1.md
8+
if [[ ! -f "$FILE" ]]; then
9+
echo "$FILE does not exist, please create it first." >&2
10+
exit 1
11+
fi
12+
13+
git add release_notes/$1.md
14+
git commit -am "add changelog for upcoming release $1"
15+
git push
16+
git tag -a $1 -m "Version $1"
17+
git push origin --tags
18+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# 3.0.0-alpha-1 (2021-04-27)
1+
# 3.0.0a1
22

33
Defines current state of project as a very early alpha release, since major refactorings have not been merged yet.

0 commit comments

Comments
 (0)