From c3574012d4b95449c736190fafdc29da9007b692 Mon Sep 17 00:00:00 2001 From: Martin Bruzina Date: Sat, 6 Dec 2025 11:51:50 +0100 Subject: [PATCH 1/5] ci: add semantic release --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index be3c391..ceac565 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ # cpp-cli Hello world C++ CLI application. + +## Features + +- [Semantic Release](.github/workflows/semantic-release.yaml) on merge to the `main` branch + +## Installation and Configuration + +### Set Up GitHub Repository for Semantic Release + +Set up GitHub actions, variables and secrets: + +- GitHub / Repository / Settings + - Actions / General + - Workflow permissions: Read and write permissions From dff04caffae381543375019ec7b88f066fdcca45 Mon Sep 17 00:00:00 2001 From: Martin Bruzina Date: Sat, 6 Dec 2025 11:51:50 +0100 Subject: [PATCH 2/5] ci: add semantic release --- .github/workflows/semantic-release.yaml | 43 +++++++++++++++++++++++++ .releaserc.yaml | 15 +++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/semantic-release.yaml create mode 100644 .releaserc.yaml diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml new file mode 100644 index 0000000..59c1c25 --- /dev/null +++ b/.github/workflows/semantic-release.yaml @@ -0,0 +1,43 @@ +--- +name: Semantic Release + +on: + push: + branches: + - main + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Install Semantic Release + run: > + npm install + semantic-release + conventional-changelog-conventionalcommits + @semantic-release/changelog + @semantic-release/exec + @semantic-release/git + semantic-release-major-tag + + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies + run: npm audit signatures + + - name: Run Semantic Release + run: npx semantic-release diff --git a/.releaserc.yaml b/.releaserc.yaml new file mode 100644 index 0000000..92b4503 --- /dev/null +++ b/.releaserc.yaml @@ -0,0 +1,15 @@ +--- +branches: + - main +plugins: + - - "@semantic-release/commit-analyzer" + - preset: conventionalcommits + - - "@semantic-release/release-notes-generator" + - preset: conventionalcommits + - "@semantic-release/github" + - - "@semantic-release/changelog" + - changelogTitle: '# Changelog' + - - "@semantic-release/git" + - assets: + - CHANGELOG.md + - semantic-release-major-tag From 34dab84faa2c9e200a7ffda209c3bc16ea5919ca Mon Sep 17 00:00:00 2001 From: Martin Bruzina Date: Sat, 6 Dec 2025 11:58:08 +0100 Subject: [PATCH 3/5] ci: fix missing semantic release github token --- .github/workflows/semantic-release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml index 59c1c25..7367597 100644 --- a/.github/workflows/semantic-release.yaml +++ b/.github/workflows/semantic-release.yaml @@ -40,4 +40,6 @@ jobs: run: npm audit signatures - name: Run Semantic Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: npx semantic-release From 95b8ba4c4dd83b451b89e0ad80823c6684d9ccc4 Mon Sep 17 00:00:00 2001 From: Martin Bruzina Date: Sat, 6 Dec 2025 12:21:57 +0100 Subject: [PATCH 4/5] feat: add cpp-cli stub --- CMakeLists.txt | 7 +++++++ README.md | 31 +++++++++++++++++++++++++++++++ src/main.cpp | 6 ++++++ 3 files changed, 44 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..59d27ce --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(cpp-cli) + +set(CMAKE_CXX_STANDARD 17) + +# Application build +add_executable(cpp-cli src/main.cpp) diff --git a/README.md b/README.md index ceac565..9c715b0 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,34 @@ Set up GitHub actions, variables and secrets: - GitHub / Repository / Settings - Actions / General - Workflow permissions: Read and write permissions + +## Development + +Install prerequisites: + +```shell +sudo apt update +sudo apt install build-essential g++ cmake git +``` + +Build: + +```shell +mkdir build +pushd build +cmake .. +make +``` + +Use: + +```shell +./cpp-cli +``` + +Cleanup: + +```shell +popd +rm -rf build/ +``` diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..9c6f43b --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::cout << "Hello world" << std::endl; + return 0; +} From 0ce6146d975ffa83c84fd841f7882bb30c8bb761 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 6 Dec 2025 11:23:05 +0000 Subject: [PATCH 5/5] chore(release): 0.1.0 [skip ci] ## [0.1.0](https://github.com/gh-ci/cpp-cli/compare/v0.0.0...v0.1.0) (2025-12-06) ### Features * add cpp-cli stub ([95b8ba4](https://github.com/gh-ci/cpp-cli/commit/95b8ba4c4dd83b451b89e0ad80823c6684d9ccc4)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..527e711 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.1.0](https://github.com/gh-ci/cpp-cli/compare/v0.0.0...v0.1.0) (2025-12-06) + +### Features + +* add cpp-cli stub ([95b8ba4](https://github.com/gh-ci/cpp-cli/commit/95b8ba4c4dd83b451b89e0ad80823c6684d9ccc4))