Skip to content

Commit f3fb47d

Browse files
committed
Add release workflow and template
- Add GitHub Actions workflow for automated releases - Add release documentation template - Update existing CI workflows for release integration
1 parent 50b237a commit f3fb47d

5 files changed

Lines changed: 164 additions & 2 deletions

File tree

.github/RELEASE_TEMPLATE.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Module Name: baselibs
2+
Release Tag: $RELEASE_TAG
3+
Origin Release Tag: $PREVIOUS_RELEASE_TAG
4+
Release Commit Hash: $COMMIT_SHA
5+
Release Date: $RELEASE_DATE
6+
7+
Overview
8+
--------
9+
The baselibs module provides a selection of basic C++ utility libraries for common use in the S-CORE project.
10+
11+
Disclaimer
12+
----------
13+
This release is not intended for production use, as it does not include a safety argumentation or a completed safety assessment.
14+
The work products compiled in the safety package are created with care according to the [S-CORE process](https://eclipse-score.github.io/process_description/main/index.html). However, as a non-profit, open-source organization, the project cannot assume any liability for its content.
15+
16+
For details on the features, see https://eclipse-score.github.io/score/main/features/baselibs/index.html
17+
18+
Improvements
19+
------------
20+
21+
Bug Fixes
22+
---------
23+
24+
Compatibility
25+
-------------
26+
- `x86_64-unknown-linux-gnu`, `x86_64-unknown-nto-qnx800` and `aarch64-unknown-nto-qnx800` using [score_toolchains_gcc](https://github.com/eclipse-score/bazel_cpp_toolchains).
27+
28+
Performed Verification
29+
----------------------
30+
- Build for `x86_64-unknown-linux-gnu` and `x86_64-unknown-nto-qnx800`.
31+
- Unit tests executed on `x86_64-unknown-linux-gnu`.
32+
33+
Report: $ACTION_RUN_URL
34+
35+
Known Issues
36+
------------
37+
38+
Upgrade Instructions
39+
--------------------
40+
Backward compatibility with the previous release is not guaranteed.
41+
42+
Contact Information
43+
-------------------
44+
For any questions or support, please contact the Base Libs Feature Team (https://github.com/orgs/eclipse-score/discussions/1223) or raise an issue/discussion.

.github/workflows/build_linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- main
2020
merge_group:
2121
types: [checks_requested]
22+
workflow_call:
2223
jobs:
2324
linux-build-and-test:
2425
runs-on: ubuntu-latest

.github/workflows/build_qnx.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- main
2020
merge_group:
2121
types: [checks_requested]
22+
workflow_call:
2223
jobs:
2324
qnx-build:
2425
strategy:

.github/workflows/coverage_report.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- main
2020
merge_group:
2121
types: [checks_requested]
22+
workflow_call:
2223
jobs:
2324
coverage-report:
2425
runs-on: ubuntu-22.04
@@ -54,6 +55,6 @@ jobs:
5455
- name: Upload Coverage Artifacts
5556
uses: actions/upload-artifact@v6
5657
with:
57-
name: ${{ github.event.repository.name }}_coverage_report
58+
name: ${{ github.event.repository.name }}_cpp_coverage_report
5859
path: cpp_coverage/
59-
retention-days: 30
60+
retention-days: 10

.github/workflows/release.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
#
14+
# This workflow automates the release process for the baselibs repository.
15+
# It is triggered manually to build, test, and validate release artifacts.
16+
# The workflow creates a draft release with a filled-out description for
17+
# maintainers to approve and publish.
18+
name: Release
19+
run-name: Release ${{ inputs.tag }}
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
tag:
24+
description: 'Release tag (e.g., v1.0.0)'
25+
required: true
26+
type: string
27+
concurrency:
28+
group: release
29+
jobs:
30+
validate-preconditions:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout Repository
34+
uses: actions/checkout@v6
35+
- name: Setup Bazel
36+
uses: bazel-contrib/setup-bazel@0.18.0
37+
with:
38+
bazelisk-cache: true
39+
disk-cache: false
40+
repository-cache: false
41+
cache-save: false
42+
- name: Validate Module Version Matches Tag
43+
env:
44+
EXPECTED_VERSION: ${{ inputs.tag }}
45+
run: |
46+
MODULE_VERSION=$(bazel mod graph --depth 1 --output json | jq -r '.version')
47+
if [ "v$MODULE_VERSION" != "$EXPECTED_VERSION" ]; then
48+
echo "::error::Module version ($MODULE_VERSION) does not match release tag ($EXPECTED_VERSION)"
49+
exit 1
50+
fi
51+
echo "✓ Module version matches release tag"
52+
build-linux:
53+
needs: validate-preconditions
54+
uses: ./.github/workflows/build_linux.yml
55+
build-qnx:
56+
needs: validate-preconditions
57+
uses: ./.github/workflows/build_qnx.yml
58+
permissions:
59+
contents: read
60+
pull-requests: read
61+
secrets: inherit
62+
coverage-report:
63+
needs: validate-preconditions
64+
uses: ./.github/workflows/coverage_report.yml
65+
create-release:
66+
needs: [validate-preconditions, build-linux, build-qnx, coverage-report]
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: write
70+
env:
71+
COVERAGE_ARCHIVE: ${{ github.event.repository.name }}-${{ inputs.tag }}-cpp-coverage
72+
steps:
73+
- name: Checkout Repository
74+
uses: actions/checkout@v6
75+
- name: Get Current Date and Previous Release Tag
76+
env:
77+
GH_TOKEN: ${{ github.token }}
78+
run: |
79+
PREVIOUS_TAG=$(gh release view --json tagName --jq '.tagName' 2>/dev/null || echo "N/A")
80+
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> $GITHUB_ENV
81+
echo "PREVIOUS_RELEASE_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
82+
- name: Generate Release Body
83+
env:
84+
RELEASE_TAG: ${{ inputs.tag }}
85+
COMMIT_SHA: ${{ github.sha }}
86+
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
87+
run: |
88+
envsubst '$RELEASE_TAG $PREVIOUS_RELEASE_TAG $COMMIT_SHA $RELEASE_DATE $ACTION_RUN_URL' < .github/RELEASE_TEMPLATE.md > release_body.md
89+
- name: Download Coverage Report Artifact
90+
uses: actions/download-artifact@v7
91+
with:
92+
name: ${{ github.event.repository.name }}_cpp_coverage_report
93+
path: ${{ env.COVERAGE_ARCHIVE }}
94+
- name: Create Coverage Report Archive
95+
run: |
96+
tar --sort=name --owner=0 --group=0 --numeric-owner \
97+
-cJf "$COVERAGE_ARCHIVE.tar.xz" "$COVERAGE_ARCHIVE"
98+
- name: Create Draft Release
99+
uses: softprops/action-gh-release@v2
100+
id: draft_release
101+
with:
102+
tag_name: ${{ inputs.tag }}
103+
body_path: release_body.md
104+
draft: true
105+
generate_release_notes: true
106+
target_commitish: ${{ github.sha }}
107+
files: |
108+
${{ env.COVERAGE_ARCHIVE }}.tar.xz
109+
- name: Summary
110+
run: |
111+
echo "### Draft Release Created :rocket:" >> $GITHUB_STEP_SUMMARY
112+
echo "Tag: **${{ inputs.tag }}**" >> $GITHUB_STEP_SUMMARY
113+
echo "Branch: \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
114+
echo "Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
115+
echo "Maintainers can review at: ${{ steps.draft_release.outputs.url }}" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)