Skip to content

Commit 4056aa5

Browse files
committed
Add release workflow
1 parent 50b237a commit 4056aa5

File tree

5 files changed

+157
-2
lines changed

5 files changed

+157
-2
lines changed

.github/RELEASE_TEMPLATE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
12+
Disclaimer
13+
----------
14+
This release is not intended for production use, as it does not include a safety argumentation or a completed safety assessment.
15+
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.
16+
17+
For details on the features, see https://eclipse-score.github.io/score/main/features/baselibs/index.html
18+
19+
Improvements
20+
------------
21+
22+
23+
Bug Fixes
24+
---------
25+
26+
27+
Compatibility
28+
-------------
29+
- `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).
30+
31+
Performed Verification
32+
----------------------
33+
- Build for `x86_64-unknown-linux-gnu` and `x86_64-unknown-nto-qnx800`.
34+
- Unit tests executed on `x86_64-unknown-linux-gnu`.
35+
36+
Report: $ACTION_RUN_URL
37+
38+
Known Issues
39+
------------
40+
41+
42+
43+
Upgrade Instructions
44+
--------------------
45+
Backward compatibility with the previous release is not guaranteed.
46+
47+
Contact Information
48+
-------------------
49+
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ on:
1919
- main
2020
merge_group:
2121
types: [checks_requested]
22+
workflow_call:
2223
jobs:
2324
qnx-build:
2425
strategy:
2526
fail-fast: false
2627
matrix:
2728
bazel-config: [bl-x86_64-qnx, bl-aarch64-qnx]
28-
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main
29+
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@fail_qnx_on_empty_secret
2930
permissions:
3031
contents: read
3132
pull-requests: read

.github/workflows/coverage_report.yml

Lines changed: 2 additions & 1 deletion
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
@@ -40,7 +41,7 @@ jobs:
4041
cache-save: ${{ github.event_name == 'push' }}
4142
- name: Run Bazel Coverage
4243
run: |
43-
bazel coverage --config=bl-x86_64-linux -- //score/... \
44+
bazel coverage --config=bl-x86_64-linux -- //score/result/... \
4445
-//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test
4546
- name: Generate HTML Coverage Report
4647
run: |

.github/workflows/release.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
name: Release
14+
run-name: Release ${{ inputs.tag }}
15+
on:
16+
pull_request:
17+
workflow_dispatch:
18+
inputs:
19+
tag:
20+
description: 'Release tag (e.g., v1.0.0)'
21+
required: true
22+
type: string
23+
concurrency:
24+
group: release
25+
jobs:
26+
validate-preconditions:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout Repository
30+
uses: actions/checkout@v6
31+
- name: Setup Bazel
32+
uses: bazel-contrib/[email protected]
33+
with:
34+
bazelisk-cache: true
35+
disk-cache: false
36+
repository-cache: false
37+
cache-save: false
38+
- name: Validate Module Version Matches Tag
39+
var:
40+
EXPECTED_VERSION: ${{ inputs.tag }}
41+
run: |
42+
MODULE_VERSION=$(bazel mod graph --depth 1 --output json | jq -r '.version')
43+
if [ "v$MODULE_VERSION" != "$EXPECTED_VERSION" ]; then
44+
echo "::error::Module version ($MODULE_VERSION) does not match release tag ($EXPECTED_VERSION)"
45+
exit 1
46+
fi
47+
echo "✓ Module version matches release tag"
48+
build-linux:
49+
needs: validate-preconditions
50+
uses: ./.github/workflows/build_linux.yml
51+
build-qnx:
52+
needs: validate-preconditions
53+
uses: ./.github/workflows/build_qnx.yml
54+
permissions:
55+
contents: read
56+
pull-requests: read
57+
secrets: inherit
58+
coverage-report:
59+
needs: validate-preconditions
60+
uses: ./.github/workflows/coverage_report.yml
61+
create-release:
62+
needs: [validate-preconditions, build-linux, build-qnx, coverage-report]
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: write
66+
env:
67+
COVERAGE_ARCHIVE: ${{ github.event.repository.name }}-v0.0.0-coverage
68+
steps:
69+
- name: Checkout Repository
70+
uses: actions/checkout@v6
71+
- name: Get Current Date and Previous Release Tag
72+
env:
73+
GH_TOKEN: ${{ github.token }}
74+
run: |
75+
PREVIOUS_TAG=$(gh release view --json tagName --jq '.tagName' 2>/dev/null || echo "N/A")
76+
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> $GITHUB_ENV
77+
echo "PREVIOUS_RELEASE_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
78+
- name: Generate Release Body
79+
env:
80+
RELEASE_TAG: ${{ inputs.tag }}
81+
COMMIT_SHA: ${{ github.sha }}
82+
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
83+
run: |
84+
envsubst '$RELEASE_TAG $PREVIOUS_RELEASE_TAG $COMMIT_SHA $RELEASE_DATE $ACTION_RUN_URL' < .github/RELEASE_TEMPLATE.md > release_body.md
85+
- name: Download Coverage Report Artifact
86+
uses: actions/download-artifact@v7
87+
with:
88+
name: ${{ github.event.repository.name }}_coverage_report
89+
path: ${{ env.COVERAGE_ARCHIVE }}
90+
- name: Create Coverage Report Archive
91+
run: |
92+
tar --sort=name --owner=0 --group=0 --numeric-owner \
93+
-cJf "$COVERAGE_ARCHIVE.tar.xz" --directory="$COVERAGE_ARCHIVE" .
94+
- name: Create Draft Release
95+
uses: softprops/action-gh-release@v2
96+
with:
97+
tag_name: "v0.0.0" # ${{ inputs.tag }}
98+
body_path: release_body.md
99+
draft: true
100+
generate_release_notes: true
101+
target_commitish: ${{ github.sha }}
102+
files: |
103+
${{ env.COVERAGE_ARCHIVE }}.tar.xz

0 commit comments

Comments
 (0)