From cbeedc631449ecc46f4f75e4d0dbee6888e5b41e Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Wed, 11 Aug 2021 11:20:51 +0100 Subject: [PATCH 1/3] Add CHANGELOG.md and use CHANGELOG_SINCE_LAST_VERSION.md to set release description --- .github/scripts/version.py | 19 ++++++++++++++++++- CHANGELOG.md | 0 CHANGELOG_SINCE_LAST_VERSION.md | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md create mode 100644 CHANGELOG_SINCE_LAST_VERSION.md diff --git a/.github/scripts/version.py b/.github/scripts/version.py index ae6be8c9..455c8ea5 100644 --- a/.github/scripts/version.py +++ b/.github/scripts/version.py @@ -22,6 +22,23 @@ if release.tag_name == f"v{version}": break else: + changelog_file = symfem.get_contents("CHANGELOG_SINCE_LAST_VERSION.md", branch.commit.sha) + changes = changelog_file.decoded_content.decode("utf8").strip() + if changes == "": + changes = "- Released new version of Symfem" symfem.create_git_tag_and_release( - f"v{version}", f"Version {version}", f"Version {version}", "Latest release", + f"v{version}", f"Version {version}", f"Version {version}", changes, branch.commit.sha, "commit") + + old_changelog_file = symfem.get_contents("CHANGELOG.md", branch.commit.sha) + old_changes = old_changelog_file.decoded_content.decode("utf8").strip() + + new_changelog = f"# Version {version}\n\n{changes}\n\n{old_changes}" + + symfem.update_file( + "CHANGELOG.md", "Update CHANGELOG.md", new_changelog, sha=old_changelog_file.sha + ) + symfem.update_file( + "CHANGELOG_SINCE_LAST_VERSION.md", "Reset CHANGELOG_SINCE_LAST_VERSION.md", "", + sha=changelog_file.sha + ) diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..e69de29b diff --git a/CHANGELOG_SINCE_LAST_VERSION.md b/CHANGELOG_SINCE_LAST_VERSION.md new file mode 100644 index 00000000..ff77c72f --- /dev/null +++ b/CHANGELOG_SINCE_LAST_VERSION.md @@ -0,0 +1,3 @@ +- Added Guzman-Neilan element +- Added nonconforming Arnold-Winther element +- Wrote JOSS paper From fa0edaa0e64dd5d27ef52490b179d99abaa13243 Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Wed, 11 Aug 2021 11:21:25 +0100 Subject: [PATCH 2/3] ++version --- .github/workflows/test-packages.yml | 8 ++++---- CITATION.cff | 4 ++-- VERSION | 2 +- codemeta.json | 2 +- setup.py | 2 +- symfem/version.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-packages.yml b/.github/workflows/test-packages.yml index 2b284653..5fc08520 100644 --- a/.github/workflows/test-packages.yml +++ b/.github/workflows/test-packages.yml @@ -18,7 +18,7 @@ jobs: python-version: ${{ matrix.python-version }} - uses: actions/checkout@v2 with: - ref: v2021.7.6 + ref: v2021.8.1 name: Get latest Symfem version - run: rm -rf symfem VERSION name: Remove downloaded symfem @@ -45,7 +45,7 @@ jobs: activate-environment: symfem - uses: actions/checkout@v2 with: - ref: v2021.7.6 + ref: v2021.8.1 name: Get latest Symfem version - run: rm -rf symfem VERSION name: Remove downloaded symfem @@ -71,13 +71,13 @@ jobs: with: python-version: ${{ matrix.python-version }} - run: | - wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2021.7.6.tar.gz + wget -O symfem.tar.gz https://pypi.io/packages/source/s/symfem/symfem-2021.8.1.tar.gz tar -xvzf symfem.tar.gz name: Download and unpack latest version of Symfem - run: pip install pytest name: Install pytest - run: | - cd symfem-2021.7.6 + cd symfem-2021.8.1 pip install -r requirements.txt python3 -m pytest test/ name: Install requirements, run tests and demos diff --git a/CITATION.cff b/CITATION.cff index 1920c3f7..dec08efe 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -5,6 +5,6 @@ authors: given-names: Matthew W. orcid: 0000-0002-4658-2443 title: Symfem -version: 2021.7.6 -date-released: 2021-07-12 +version: 2021.8.1 +date-released: 2021-08-11 license: MIT diff --git a/VERSION b/VERSION index bd2c2ca2..3f8cfaf5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2021.7.6 \ No newline at end of file +2021.8.1 \ No newline at end of file diff --git a/codemeta.json b/codemeta.json index 8d2bd410..12539caa 100644 --- a/codemeta.json +++ b/codemeta.json @@ -1 +1 @@ -{"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "Code", "author": [{"@id": "0000-0002-4658-2443", "@type": "Person", "email": "mws48@cam.ac.uk", "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"} \ No newline at end of file +{"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld", "@type": "Code", "author": [{"@id": "0000-0002-4658-2443", "@type": "Person", "email": "mws48@cam.ac.uk", "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"} \ No newline at end of file diff --git a/setup.py b/setup.py index 78dddac4..6bebae03 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ description="a symbolic finite element definition library", long_description=long_description, long_description_content_type="text/markdown", - version="2021.7.6", + version="2021.8.1", author="Matthew Scroggs", license="MIT", author_email="symfem@mscroggs.co.uk", diff --git a/symfem/version.py b/symfem/version.py index 3f3a3151..6ef4bb62 100644 --- a/symfem/version.py +++ b/symfem/version.py @@ -1,3 +1,3 @@ """Version number.""" -version = "2021.7.6" +version = "2021.8.1" From 0aa958e9368e2786916226d72ec0a160b30c0c7a Mon Sep 17 00:00:00 2001 From: Matthew Scroggs Date: Wed, 11 Aug 2021 11:24:18 +0100 Subject: [PATCH 3/3] put date in changelog --- .github/scripts/version.py | 4 +++- CHANGELOG.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/scripts/version.py b/.github/scripts/version.py index 455c8ea5..384fb8c8 100644 --- a/.github/scripts/version.py +++ b/.github/scripts/version.py @@ -1,6 +1,7 @@ import json import sys import github +from datetime import datetime access_key = sys.argv[-1] @@ -33,7 +34,8 @@ old_changelog_file = symfem.get_contents("CHANGELOG.md", branch.commit.sha) old_changes = old_changelog_file.decoded_content.decode("utf8").strip() - new_changelog = f"# Version {version}\n\n{changes}\n\n{old_changes}" + new_changelog = (f"# Version {version} ({datetime.now().strftime('%d %B %Y')})\n\n" + f"{changes}\n\n{old_changes}") symfem.update_file( "CHANGELOG.md", "Update CHANGELOG.md", new_changelog, sha=old_changelog_file.sha diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29b..6ad08f0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# 11 August 2021 + +- Started keeping changelog