Skip to content
Open
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
58 changes: 58 additions & 0 deletions .github/scripts/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
#
# Copyright 2025 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -ue

# Thanks to https://ihateregex.io/expr/semver/
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-]+)*))?$'

REL_VERSION=`echo $1 | sed -r 's/^[vV]?([0-9].+)$/\1/'`

if [ `echo $REL_VERSION | pcre2grep "$SEMVER_REGEX"` ]; then
echo "$REL_VERSION is a valid semantic version."
else
echo "$REL_VERSION is not a valid semantic version."
exit 1
fi

MAJOR_MINOR_VERSION=`echo $REL_VERSION | cut -d. -f1,2`
RELEASE_BRANCH="release-$MAJOR_MINOR_VERSION"
RELEASE_TAG="v$REL_VERSION"
SUFFIX=`echo $REL_VERSION | grep \- | cut -d- -f2 | cut -d. -f1`
if [ "$SUFFIX" == "alpha" ]; then
# Alpha releases come from the master branch as they are not complete for an RC yet.
RELEASE_BRANCH="master"
fi

if [ `git rev-parse --verify origin/$RELEASE_BRANCH 2>/dev/null` ]; then
echo "$RELEASE_BRANCH branch already exists, checking it out ..."
git checkout $RELEASE_BRANCH
else
echo "$RELEASE_BRANCH does not exist, creating ..."
git checkout -b $RELEASE_BRANCH
git push origin $RELEASE_BRANCH
fi
echo "$RELEASE_BRANCH branch is ready."

if [ `git rev-parse --verify $RELEASE_TAG 2>/dev/null` ]; then
echo "$RELEASE_TAG tag already exists, aborting ..."
exit 2
fi

echo "Tagging $RELEASE_TAG ..."
git tag $RELEASE_TAG
echo "$RELEASE_TAG is tagged."

echo "Pushing $RELEASE_TAG tag ..."
git push origin $RELEASE_TAG
echo "$RELEASE_TAG tag is pushed."
49 changes: 49 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Copyright 2025 The Dapr Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Create a release

on:
workflow_dispatch:
inputs:
rel_version:
description: 'Release version (examples: 1.16.0-rc.1, 1.16.0)'
required: true
type: string

permissions: {}

jobs:
create-release:
name: Creates release branch and tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install pcre2-utils
- name: Create release branch and tag
env:
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
run: |
git config user.email "daprweb@diagrid.io"
git config user.name "Dapr Bot"
# Update origin with token
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
./.github/scripts/create-release.sh ${{ inputs.rel_version }}
13 changes: 13 additions & 0 deletions docs/development/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ Only the repository maintainers and release team are allowed to execute the belo

## Pre-release build

### Dapr CLI manual release process

Pre-release build will be built from `release-<major>.<minor>` branch and versioned by git version tag suffix e.g. `-rc.0`, `-rc.1`, etc. This build is not released to users who use the latest stable version.

**Pre-release process**
1. Create a PR to update the `Dapr runtime` and `Dapr dashboard` pre-release versions in workflow and tests files wherever applicable, and merge the PR to master branch. For example, please take a look at this PR - https://github.com/dapr/cli/pull/1019. Please note that this PR is just for reference and only reflects the absolute minimum number of file changes. These versions update could lead to some other changes also.

Expand All @@ -33,6 +36,12 @@ $ git push upstream v1.11.0-rc.0
7. Create new pre-release version tag (with suffix -rc.1, -rc.2, etc).
8. Repeat from 5 to 7 until all bugs are fixed.

### Dapr CLI automated release process

The Dapr CLI automated release process is triggered by the `create-release` workflow. This workflow is triggered by the `create-release` button in the GitHub Actions UI.

This workflow will create a new release branch and tag, and trigger the Dapr CLI build.


## Release the stable version to users

Expand All @@ -43,3 +52,7 @@ Once all bugs are fixed, stable version can be released. Create a new git versio
## Release Patch version

Work on the existing `release-<major>.<minor>` branch to release a patch version. Once all bugs are fixed, create a new patch version tag, such as `v1.11.1-rc.0`. After verifying the fixes on this pre-release, create a new git version tag such as `v1.11.1` and push the tag. CI will create the new build artifacts and release them.

## Project Release Guidelines

See [this document](https://github.com/dapr/community/blob/master/release-process.md) for the project's release process and guidelines.
Loading