Skip to content

Commit 68de155

Browse files
authored
Add changelog (#120)
* Add CHANGELOG.md and use CHANGELOG_SINCE_LAST_VERSION.md to set release description * ++version * put date in changelog
1 parent fd46ca8 commit 68de155

File tree

9 files changed

+36
-11
lines changed

9 files changed

+36
-11
lines changed

.github/scripts/version.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import sys
33
import github
4+
from datetime import datetime
45

56
access_key = sys.argv[-1]
67

@@ -22,6 +23,24 @@
2223
if release.tag_name == f"v{version}":
2324
break
2425
else:
26+
changelog_file = symfem.get_contents("CHANGELOG_SINCE_LAST_VERSION.md", branch.commit.sha)
27+
changes = changelog_file.decoded_content.decode("utf8").strip()
28+
if changes == "":
29+
changes = "- Released new version of Symfem"
2530
symfem.create_git_tag_and_release(
26-
f"v{version}", f"Version {version}", f"Version {version}", "Latest release",
31+
f"v{version}", f"Version {version}", f"Version {version}", changes,
2732
branch.commit.sha, "commit")
33+
34+
old_changelog_file = symfem.get_contents("CHANGELOG.md", branch.commit.sha)
35+
old_changes = old_changelog_file.decoded_content.decode("utf8").strip()
36+
37+
new_changelog = (f"# Version {version} ({datetime.now().strftime('%d %B %Y')})\n\n"
38+
f"{changes}\n\n{old_changes}")
39+
40+
symfem.update_file(
41+
"CHANGELOG.md", "Update CHANGELOG.md", new_changelog, sha=old_changelog_file.sha
42+
)
43+
symfem.update_file(
44+
"CHANGELOG_SINCE_LAST_VERSION.md", "Reset CHANGELOG_SINCE_LAST_VERSION.md", "",
45+
sha=changelog_file.sha
46+
)

.github/workflows/test-packages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
python-version: ${{ matrix.python-version }}
1919
- uses: actions/checkout@v2
2020
with:
21-
ref: v2021.7.6
21+
ref: v2021.8.1
2222
name: Get latest Symfem version
2323
- run: rm -rf symfem VERSION
2424
name: Remove downloaded symfem
@@ -45,7 +45,7 @@ jobs:
4545
activate-environment: symfem
4646
- uses: actions/checkout@v2
4747
with:
48-
ref: v2021.7.6
48+
ref: v2021.8.1
4949
name: Get latest Symfem version
5050
- run: rm -rf symfem VERSION
5151
name: Remove downloaded symfem
@@ -71,13 +71,13 @@ jobs:
7171
with:
7272
python-version: ${{ matrix.python-version }}
7373
- run: |
74-
wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2021.7.6.tar.gz
74+
wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2021.8.1.tar.gz
7575
tar -xvzf symfem.tar.gz
7676
name: Download and unpack latest version of Symfem
7777
- run: pip install pytest
7878
name: Install pytest
7979
- run: |
80-
cd symfem-2021.7.6
80+
cd symfem-2021.8.1
8181
pip install -r requirements.txt
8282
python3 -m pytest test/
8383
name: Install requirements, run tests and demos

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 11 August 2021
2+
3+
- Started keeping changelog

CHANGELOG_SINCE_LAST_VERSION.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Added Guzman-Neilan element
2+
- Added nonconforming Arnold-Winther element
3+
- Wrote JOSS paper

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ authors:
55
given-names: Matthew W.
66
orcid: 0000-0002-4658-2443
77
title: Symfem
8-
version: 2021.7.6
9-
date-released: 2021-07-12
8+
version: 2021.8.1
9+
date-released: 2021-08-11
1010
license: MIT

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.7.6
1+
2021.8.1

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "Code", "author": [{"@id": "0000-0002-4658-2443", "@type": "Person", "email": "[email protected]", "name": "Matthew Scroggs", "affiliation": "Department of Engineering, University of Cambridge"}], "identifier": "", "codeRepository": "https://github.com/mscroggs/symfem", "datePublished": "2021-01-23", "dateModified": "2021-07-12", "dateCreated": "2021-01-23", "description": "A symbolic finite element definition library", "keywords": "Python, finite element method, numerical analysis", "license": "MIT", "title": "Symfem", "version": "2021.7.6"}
1+
{"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "Code", "author": [{"@id": "0000-0002-4658-2443", "@type": "Person", "email": "[email protected]", "name": "Matthew Scroggs", "affiliation": "Department of Engineering, University of Cambridge"}], "identifier": "", "codeRepository": "https://github.com/mscroggs/symfem", "datePublished": "2021-01-23", "dateModified": "2021-08-11", "dateCreated": "2021-01-23", "description": "A symbolic finite element definition library", "keywords": "Python, finite element method, numerical analysis", "license": "MIT", "title": "Symfem", "version": "2021.8.1"}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
description="a symbolic finite element definition library",
2323
long_description=long_description,
2424
long_description_content_type="text/markdown",
25-
version="2021.7.6",
25+
version="2021.8.1",
2626
author="Matthew Scroggs",
2727
license="MIT",
2828
author_email="[email protected]",

symfem/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version number."""
22

3-
version = "2021.7.6"
3+
version = "2021.8.1"

0 commit comments

Comments
 (0)