Skip to content

Commit 24ecbe7

Browse files
Merge pull request #57 from ZettaScaleLabs/prep-open-source-release
chore: preparation for open source release
2 parents 6e5a078 + af0f530 commit 24ecbe7

4 files changed

Lines changed: 646 additions & 77 deletions

File tree

.github/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# Copyright (c) 2026 ZettaScale Technology
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License 2.0 which is available at
6+
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
#
9+
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
#
11+
# Contributors:
12+
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
13+
#
14+
15+
changelog:
16+
categories:
17+
- title: Breaking changes 💥
18+
labels:
19+
- breaking-change
20+
- title: New features 🎉
21+
labels:
22+
- enhancement
23+
- new feature
24+
exclude:
25+
labels:
26+
- internal
27+
- title: Bug fixes 🐞
28+
labels:
29+
- bug
30+
exclude:
31+
labels:
32+
- internal
33+
- title: Documentation 📝
34+
labels:
35+
- documentation
36+
exclude:
37+
labels:
38+
- internal
39+
- title: Dependencies 👷
40+
labels:
41+
- dependencies
42+
exclude:
43+
labels:
44+
- internal
45+
- title: Other changes
46+
labels:
47+
- "*"
48+
exclude:
49+
labels:
50+
- internal

.github/workflows/release.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Copyright (c) 2026 ZettaScale Technology
2+
#
3+
# This program and the accompanying materials are made available under the
4+
# terms of the Eclipse Public License 2.0 which is available at
5+
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
6+
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
7+
#
8+
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
9+
#
10+
# Contributors:
11+
# ZettaScale Zenoh Team, <zenoh@zettascale.tech>
12+
#
13+
name: Release
14+
15+
on:
16+
schedule:
17+
- cron: "0 0 * * 1-5"
18+
workflow_dispatch:
19+
inputs:
20+
live-run:
21+
type: boolean
22+
description: Live-run
23+
required: false
24+
default: false
25+
version:
26+
type: string
27+
description: Release number
28+
required: false
29+
branch:
30+
type: string
31+
description: Release branch
32+
required: false
33+
34+
jobs:
35+
version_and_tag:
36+
name: Compute version and tag
37+
runs-on: ubuntu-latest
38+
outputs:
39+
version: ${{ steps.version_and_tag.outputs.version }}
40+
tag: ${{ steps.version_and_tag.outputs.tag }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0 # Fetch all history for all tags and branches
45+
46+
- id: version_and_tag
47+
name: Compute version and tag
48+
run: |
49+
set -euo pipefail
50+
51+
if [ -n "${{ inputs.version }}" ]; then
52+
raw_version='${{ inputs.version }}'
53+
else
54+
# Extract the version from the latest tag
55+
raw_version=$(git tag --list 'v*' --sort=-version:refname | head -n 1)
56+
if [ -z "$raw_version" ]; then
57+
echo "No release tag matching v* found"
58+
exit 1
59+
fi
60+
fi
61+
62+
version="${raw_version#v}"
63+
# Use 'v' prefix in the tag for go modules compatibility'
64+
tag="v${version}"
65+
66+
printf "version=%s\n" "$version" >> "$GITHUB_OUTPUT"
67+
printf "tag=%s\n" "$tag" >> "$GITHUB_OUTPUT"
68+
tag:
69+
name: Branch, Bump & tag
70+
runs-on: ubuntu-latest
71+
needs: version_and_tag
72+
outputs:
73+
branch: ${{ steps.create-release-branch.outputs.branch }}
74+
steps:
75+
- id: create-release-branch
76+
uses: eclipse-zenoh/ci/create-release-branch@main
77+
with:
78+
repo: ${{ github.repository }}
79+
live-run: ${{ inputs.live-run || false }}
80+
version: ${{ needs.version_and_tag.outputs.version }}
81+
branch: ${{ inputs.branch }}
82+
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
83+
84+
- name: Checkout release branch
85+
uses: actions/checkout@v4
86+
with:
87+
ref: ${{ steps.create-release-branch.outputs.branch }}
88+
fetch-depth: 0
89+
token: ${{ secrets.BOT_TOKEN_WORKFLOW }}
90+
91+
- name: Create annotated tag
92+
if: ${{ inputs.live-run || false }}
93+
shell: bash
94+
run: |
95+
git fetch --tags origin
96+
if git rev-parse '${{ needs.version_and_tag.outputs.tag }}' >/dev/null 2>&1; then
97+
echo "Tag ${{ needs.version_and_tag.outputs.tag }} already exists"
98+
exit 1
99+
fi
100+
git config user.name "eclipse-zenoh-bot"
101+
git config user.email "eclipse-zenoh-bot@users.noreply.github.com"
102+
git tag -a '${{ needs.version_and_tag.outputs.tag }}' -m '${{ needs.version_and_tag.outputs.tag }}'
103+
104+
- name: Push tag
105+
if: ${{ inputs.live-run || false }}
106+
shell: bash
107+
run: |
108+
git push origin '${{ needs.version_and_tag.outputs.tag }}'
109+
110+
- name: Create GitHub Release
111+
if: ${{ inputs.live-run || false }}
112+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe
113+
with:
114+
draft: false
115+
prerelease: false
116+
tag_name: ${{ needs.version_and_tag.outputs.tag }}
117+
generate_release_notes: true
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }}

0 commit comments

Comments
 (0)