diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9f6af2402..caa535f62 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -169,10 +169,3 @@ jobs: - name: Dependency barrier if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') run: exit 1 - - tag-minor-release: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - needs: - - all - uses: ./.github/workflows/tag-minor-release.yaml - secrets: inherit diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 000000000..f30786dbe --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Release Please + +on: + push: + branches: [master] + workflow_dispatch: + +permissions: + actions: write + contents: write + pull-requests: write + +jobs: + release-please: + name: Prepare Release + runs-on: ubuntu-latest + steps: + - id: release + uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} + target-branch: master + + # A tag pushed with GITHUB_TOKEN starts no workflow, but a dispatch always does. + - name: Start the release pipeline + if: steps.release.outputs.release_created == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ steps.release.outputs.tag_name }} + run: gh workflow run ci.yaml --repo "${GITHUB_REPOSITORY}" --ref "${TAG}" diff --git a/.github/workflows/tag-minor-release.yaml b/.github/workflows/tag-minor-release.yaml deleted file mode 100644 index 26ef0fee1..000000000 --- a/.github/workflows/tag-minor-release.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University -# SPDX-License-Identifier: Apache-2.0 - -name: Tag Minor Release - -on: - workflow_call: {} - -jobs: - tag-minor-release: - name: Tag Next Minor Version - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - fetch-depth: 0 - fetch-tags: true - - - name: Determine and create next minor tag - id: next_tag - run: | - set -euo pipefail - - git fetch --tags --force - - latest_tag=$(git tag --list 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1 || true) - - if [[ -z "${latest_tag}" ]]; then - next_tag="v0.1.0" - else - version="${latest_tag#v}" - major="${version%%.*}" - rest="${version#*.}" - minor="${rest%%.*}" - next_tag="v${major}.$((minor + 1)).0" - fi - - if git rev-parse "${next_tag}" >/dev/null 2>&1; then - echo "Tag ${next_tag} already exists. Skipping creation." - echo "created=false" >> "$GITHUB_OUTPUT" - echo "tag=${next_tag}" >> "$GITHUB_OUTPUT" - exit 0 - fi - - git tag -a "${next_tag}" -m "Release ${next_tag}" - git push origin "${next_tag}" - - echo "created=true" >> "$GITHUB_OUTPUT" - echo "tag=${next_tag}" >> "$GITHUB_OUTPUT" - - - name: Report created tag - run: | - if [[ "${{ steps.next_tag.outputs.created }}" == "true" ]]; then - echo "Created and pushed tag: ${{ steps.next_tag.outputs.tag }}" - else - echo "No new tag created. Existing tag: ${{ steps.next_tag.outputs.tag }}" - fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71fbea36b..ea814d294 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,7 +65,7 @@ repos: rev: "v0.13.0" hooks: - id: markdownlint - exclude: ^paper\.md$ + exclude: ^paper\.md$|^CHANGELOG\.md$ args: [-r, "~MD013,~MD033,~MD024"] - repo: local diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..8d7e5f136 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.1" +} diff --git a/CMakeLists.txt b/CMakeLists.txt index f795c0a65..8b7e8d5d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.14) project(villas-node - VERSION 1.1.0 + VERSION 1.1.0 # x-release-please-version DESCRIPTION "Open-Source Real-time Multi-protocol Gateway" HOMEPAGE_URL "https://www.fein-aachen.org/projects/villas-node/" LANGUAGES C CXX diff --git a/REUSE.toml b/REUSE.toml index e3507eccf..f00a14d32 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -8,6 +8,7 @@ SPDX-PackageDownloadLocation = "https://fein-aachen.org/en/projects/villas-node/ [[annotations]] path = [ + "CHANGELOG.md", "**.prefs", "**.vi", "**.opal", diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..31aebf9ef --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "packages": { + ".": { + "extra-files": [ + "CMakeLists.txt", + { + "type": "toml", + "path": "python/pyproject.toml", + "jsonpath": "$.project.version" + }, + { + "type": "json", + "path": "doc/package.json", + "jsonpath": "$.version" + } + ] + } + } +}