Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for release 0.1.0 #2

Merged
merged 9 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## DLA-Future-Fortran 0.1.0

First release of [DLA-Future-Fortran], a Fortran interface for [DLA-Future].

[DLA-Future]: https://github.com/eth-cscs/DLA-Future
[DLA-Future-Fortran]: https://github.com/eth-cscs/DLA-Future-Fortran
42 changes: 42 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
cff-version: 1.2.0
title: DLA-Future-Fortran 0.1.0
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Rocco
family-names: Meli
orcid: 'https://orcid.org/0000-0002-2845-3410'
- given-names: John
family-names: Biddiscombe
orcid: 'https://orcid.org/0000-0002-6552-2833'
- given-names: Alberto
family-names: Invernizzi
orcid: 'https://orcid.org/0009-0004-4948-0313'
- given-names: Auriane
family-names: Reverdell
orcid: 'https://orcid.org/0000-0002-5531-0458'
- given-names: Mikael
family-names: Simberg
orcid: 'https://orcid.org/0000-0002-7238-8935'
- given-names: Raffaele
family-names: Solcà
orcid: 'https://orcid.org/0009-0009-9346-4376'
- given-names: Mathieu
family-names: Taillefumier
orcid: 'https://orcid.org/0000-0002-3983-5625'
repository-code: 'https://github.com/eth-cscs/DLA-Future-Fortran'
abstract: Fortran interface for DLA-Future (Distributed Linear Algebra from the Future)
keywords:
- fortran
- eigensolver
- "generalized eigensolver"
- "Cholesky decomposition"
- scalapack
- "high performance computing"
- "linear algebra"
- mpi
license: BSD-3-Clause
version: 0.1.0
date-released: '2024-05-15'
31 changes: 31 additions & 0 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Release procedure for DLA-Future-Fortran

DLA-Future-Fortran follows [Semantic Versioning](https://semver.org).

1. For minor and major releases: check out the `main` branch. All changes required for the release are
added to `main` via pull requests. For patch releases: check out the corresponding
`release-major.minor` branch.

1. Write release notes in `CHANGELOG.md`.

1. Update the version in `CMakeLists.txt`.

1. Update the version and date in `CITATION.cff`.

1. When making a major release, remove deprecated functionality if appropriate.

1. Update the minimum required versions if necessary.

1. Ensure you have [GitHub CLI](https://cli.github.com) installed. Run `gh auth login` to authenticate with
your GitHub account, or set the `GITHUB_TOKEN` to a token with `public_repo` access.

1. Create a release on GitHub using the script `scripts/roll_release.sh`.

1. Update Spack recipe in `spack/packages/dla-future-fortran/package.py` adding the new release.

1. Synchronize [upstream Spack
package](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/dla-future-fortran/package.py)
with local repository. Exclude blocks delimited by `# !!!` comments. These are only intended for the
internal Spack package.

1. Delete your `GITHUB_TOKEN` if created only for the release.
140 changes: 140 additions & 0 deletions scripts/roll_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#!/usr/bin/env bash

#
# Distributed Linear Algebra with Future (DLAF)
#
# Copyright (c) 2018-2024, ETH Zurich
# All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#

# This script tags a release locally and creates a release on GitHub. It relies
# on the GitHub CLI (https://cli.github.com).

set -o errexit

VERSION_MAJOR=$(sed -n 's/project(DLAFFortran VERSION \([0-9]\+\)\.[0-9]\+\.[0-9]\+ .*)/\1/p' CMakeLists.txt)
VERSION_MINOR=$(sed -n 's/project(DLAFFortran VERSION [0-9]\+\.\([0-9]\+\)\.[0-9]\+ .*)/\1/p' CMakeLists.txt)
VERSION_PATCH=$(sed -n 's/project(DLAFFortran VERSION [0-9]\+\.[0-9]\+\.\([0-9]\+\) .*)/\1/p' CMakeLists.txt)
VERSION_FULL="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
VERSION_FULL_TAG="v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
VERSION_TITLE="DLA-Future-Fortran ${VERSION_FULL}"
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
RELEASE_DATE=$(date '+%Y-%m-%d')

if ! which gh >/dev/null 2>&1; then
echo "GitHub CLI not installed on this system (see https://cli.github.com). Exiting."
exit 1
fi

# Major and minor releases are made directly from main. Patch releases are branched out from the major
# and minor releases with a version_X.Y branch.
if [[ "${VERSION_PATCH}" -eq 0 ]]; then
RELEASE_BRANCH="main"
else
RELEASE_BRANCH="release-${VERSION_MAJOR}.${VERSION_MINOR}"
fi

if ! [[ "$CURRENT_BRANCH" == "$RELEASE_BRANCH" ]]; then
echo "Not on release branch (expected \"$RELEASE_BRANCH\", currently on \"${CURRENT_BRANCH}\"). Not continuing to make release."
exit 1
fi

changelog_path="CHANGELOG.md"
cff_path="CITATION.cff"

echo "You are about to tag and create a final release on GitHub."

echo ""
echo "Sanity checking release"

sanity_errors=0

printf "Checking that %s has an entry for %s... " "${changelog_path}" "${VERSION_FULL}"
if grep "## DLA-Future-Fortran ${VERSION_FULL}" "${changelog_path}"; then
echo "OK"
else
echo "ERROR"
sanity_errors=$((sanity_errors + 1))
fi

printf "Checking that %s has correct version for %s... " "${cff_path}" "${VERSION_FULL}"
if grep "^version: ${VERSION_FULL}" "${cff_path}"; then
echo "OK"
else
echo "ERROR"
sanity_errors=$((sanity_errors + 1))
fi

printf "Checking that %s has correct title for %s... " "${cff_path}" "${VERSION_FULL}"
if grep "^title: ${VERSION_TITLE}" "${cff_path}"; then
echo "OK"
else
echo "ERROR"
sanity_errors=$((sanity_errors + 1))
fi

printf "Checking that %s has today's date... " "${cff_path}"
if grep "^date-released: '${RELEASE_DATE}'" "${cff_path}"; then
echo "OK"
else
echo "ERROR"
sanity_errors=$((sanity_errors + 1))
fi

if [[ ${sanity_errors} -gt 0 ]]; then
echo "Found ${sanity_errors} error(s). Fix it/them and try again."
exit 1
fi

# Extract the changelog for this version
VERSION_DESCRIPTION=$(
# Find the correct heading and print everything from there to the end of the file
awk "/^## DLA-Future-Fortran ${VERSION_FULL}/,EOF" ${changelog_path} |
# Remove the heading
tail -n+3 |
# Find the next heading or the end of the file and print everything until that heading
sed '/^## /Q' |
# Move headings one level up, i.e. transform ### to ##, ## to #, etc. There should be no
# top-level heading in the file except for "# Changelog".
sed 's/^##/#/'
)

echo ""
echo "The version is: ${VERSION_FULL}"
echo "The version title is: ${VERSION_TITLE}"
echo "The release date is: ${RELEASE_DATE}"
echo "The version description is:"
echo "${VERSION_DESCRIPTION}"

echo "Do you want to continue?"
select yn in "Yes" "No"; do
case $yn in
Yes) break ;;
No) exit ;;
esac
done

echo ""
if [[ "$(git tag -l ${VERSION_FULL_TAG})" == "${VERSION_FULL_TAG}" ]]; then
echo "Tag already exists locally."
else
echo "Tagging release."
git tag --annotate "${VERSION_FULL_TAG}" --message="${VERSION_TITLE}"
fi

remote=$(git remote -v | grep github.com:eth-cscs\/DLA-Future-Fortran.git | cut -f1 | uniq)
if [[ "$(git ls-remote --tags --refs $remote | grep -o ${VERSION_FULL_TAG})" == "${VERSION_FULL_TAG}" ]]; then
echo "Tag already exists remotely."
else
echo "Pushing tag to $remote."
git push $remote "${VERSION_FULL_TAG}"
fi

echo ""
echo "Creating release."
gh release create "${VERSION_FULL_TAG}" \
--title "${VERSION_TITLE}" \
--notes "${VERSION_DESCRIPTION}"
2 changes: 1 addition & 1 deletion spack/packages/dla-future-fortran/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DlaFutureFortran(CMakePackage):
url = "https://github.com/eth-cscs/DLA-Future-Fortran/archive/v0.0.0.tar.gz"
git = "https://github.com/eth-cscs/DLA-Future-Fortran.git"

maintainers("RMeli")
maintainers("RMeli", "rasolca")

license("BSD-3-Clause")

Expand Down
Loading