diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..726419a4c6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +### Added + * Trace API and SDK + * OTLP Exporter +### Changed +### Removed \ No newline at end of file diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000000..802ac1f6af --- /dev/null +++ b/INSTALL.md @@ -0,0 +1 @@ +## TODO diff --git a/README.md b/README.md index 2c17a0cd9c..ef6f18135a 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ Any exceptions to this are noted in the individual `README.md` files. ## Installation -TBD +Please refer to [INSTALL.md](./INSTALL.md). -## Quick Start - -TBD +## QuickStart +The `examples/simple` directory contains a minimal program demonstrating +how to instrument a small library using a simple `processor` and console `exporter`, along with build files for CMake and Bazel. ## Contributing diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000000..c4a111fdbf --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,39 @@ +# Release Process + +## Pre Release + +1. Make sure all relevant changes for this release are included under `Unreleased` section in `CHANGELOG.md` and are in language that non-contributors to the project can understand. + +2. Run the pre-release script. It creates a branch `pre_release_` and updates `CHANGELOG.md` with the ``: + ``` + ./pre_release.sh -t + ``` +3. Verify that CHANGELOG.md is updated properly: + ``` + git diff master + ``` +4. Push the changes to upstream and create a Pull Request on GitHub. + Be sure to include the curated changes from the [Changelog](./CHANGELOG.md) in the description. + +## Tag + +Once the above Pull Request has been approved and merged it is time to tag the merged commit. + +***IMPORTANT***: It is critical you use the same tag that you used in the Pre-Release step! +Failure to do so will leave things in a broken state. + +1. Note down the commit hash of the master branch after above PR request is merged : + ``` + git show -s --format=%H + ``` +2. Create a github tag on this commit hash: + ``` + git tag -a "" -s -m "Version " "" + +3. Push tag to upstream remote + ``` + git push upstream + ``` + +## Release +Finally create a Release for the new on GitHub. The release body should include all the release notes from the Changelog for this release. diff --git a/pre_release.sh b/pre_release.sh new file mode 100644 index 0000000000..5765fb5ef9 --- /dev/null +++ b/pre_release.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +usage() { echo "Usage: $0 -t " 1>&2; exit 1; } + +while getopts ":t:" o; do + case "${o}" in + t) + tag=${OPTARG} + ;; + *) + usage + ;; + esac +done +if [ ! -z "${t}" ]; then + usage +fi + +#validate tag +semver_regex="^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" +if [[ ${tag} =~ ${semver_regex} ]]; then + echo "${tag} is valid semver tag" +else + echo "Error: ${tag} is not a valid semver tag. Exiting" + exit -1 +fi + +#ensure tag doesn't exits +if [[ $(git tag --list ${tag}) ]]; then + echo "Error: Tag ${tag} already exists. Exiting" + exit -1 +fi + +if ! git diff --quiet; then \ + echo "Error: Working tree is not clean, can't proceed with the release process\n" + git status + git diff + exit 1 +fi + +# check changelog exists +changelog_file="./CHANGELOG.md" +if [ ! -f $changelog_file ]; then + echo "Error: $changelog_file doesn't exist. Ensure that you are running this script from repo root directory " + exit 1 +fi + +if [ ! grep -q "## [Unreleased]" $changelog_file ]; then + echo "Error: $changelog_file doesn't contain Unreleased information. Please update the file with changes and run this script again." + exit 1 +fi + +git checkout -b pre_release_${tag} master +if [ $? -ne 0 ]; then + echo "Error: Cannot create release branch. Ensure you have sufficient permissions to repo and try again." + exit 1 +fi + +# update CHANGELOG.md +date=$(date '+%Y-%m-%d') +sed -i "/\#\# \[Unreleased\]/a\\ \n\#\# \[${tag}\] ${date}" $changelog_file +if [$? -ne 0]; then + echo "Error: Cannot update CHANGELOG.md file. Update it manually, create the ${tag} and push changes to upstream" + exit 1 +fi + +git add . +git commit -m "Prepare for releasing ${tag}" + +echo "Now validate the chages using git diff master, create the ${tag} and push changes to upstream" +echo