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

scripts: add release script #164

Merged
merged 3 commits into from
Jul 2, 2024
Merged

scripts: add release script #164

merged 3 commits into from
Jul 2, 2024

Conversation

joshuasing
Copy link
Contributor

Summary
Add a definitely not over engineered release script to easily and safely create and push git tags.

Tags the latest remote commit in the heminetwork repository's main branch and pushes the tag to the repository, triggering the release CI which will build all necessary binaries, Docker images, etc. and create a GitHub release.

This script will create a new remote called upstream (configurable with REMOTE_NAME). This remote is used to fetch the latest commit on the main branch, allowing a tag to be created on the latest remote commit while ignoring any local changes.

The provided version (and all version bumps) must follow the Semantic Versioning 2.0.0 specification (..), as per https://semver.org/. This allows the versioning to stay consistent while easily communicating the type of change the version contains to users.

This script will always confirm with you before creating or pushing the tag, in an attempt to prevent accidental tag creation or pushes.

Usage:

./scripts/release.sh <version>

Requirements:

  • git (configured correctly)
  • gpg (and git configured to use signing key)
  • ssh (and key with access to repository)
  • grep
  • sed

Changes

  • Add scripts/release.sh

Add a _definitely not over engineered_ release script to easily and
safely create and push git tags.
@joshuasing joshuasing added type: enhancement This improves existing functionality size: M This change is medium (+/- <200) labels Jul 1, 2024
@joshuasing joshuasing requested a review from a team as a code owner July 1, 2024 16:22
}

# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
SEMVER_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

scripts/release.sh Outdated Show resolved Hide resolved
scripts/release.sh Show resolved Hide resolved
Copy link
Contributor

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@joshuasing joshuasing merged commit 6716604 into main Jul 2, 2024
5 checks passed
@joshuasing joshuasing deleted the joshua/scripts/release branch July 2, 2024 17:38
web3cryptoguy pushed a commit to web3cryptoguy/heminetwork that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M This change is medium (+/- <200) type: enhancement This improves existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants