feat(ci): add automated release workflow for fast-forward and tagging

Adds a new GitHub Actions workflow that:
- Fast-forwards master branch from develop
- Creates and pushes a new release tag
- Requires manual trigger with tag name input

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2025-03-19 21:43:09 +01:00
parent cf4e915430
commit b99e6612e2
3 changed files with 33 additions and 55 deletions

View File

@@ -1,28 +0,0 @@
name: fast-forward
on:
issue_comment:
types: [ created, edited ]
jobs:
fast-forward:
# Only run if the comment contains the /fast-forward command.
if: |
contains(github.event.comment.body, '/fast-forward') &&
github.event.issue.pull_request &&
github.base_ref == 'develop'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- name: Fast forwarding
uses: sequoia-pgp/fast-forward@v1
with:
merge: true
# To reduce the workflow's verbosity, use 'on-error'
# to only post a comment when an error occurs, or 'never' to
# never post a comment. (In all cases the information is
# still available in the step's summary.)
comment: on-error

View File

@@ -1,27 +0,0 @@
name: pull-request
on:
pull_request:
branches:
- develop
types: [ opened, reopened, synchronize ]
jobs:
check-fast-forward:
runs-on: ubuntu-latest
permissions:
contents: read
# We appear to need write permission for both pull-requests and
# issues in order to post a comment to a pull request.
pull-requests: write
issues: write
steps:
- name: Checking if fast forwarding is possible
uses: sequoia-pgp/fast-forward@v1
with:
merge: false
# To reduce the workflow's verbosity, use 'on-error'
# to only post a comment when an error occurs, or 'never' to
# never post a comment. (In all cases the information is
# still available in the step's summary.)
comment: on-error

View File

@@ -0,0 +1,33 @@
name: Release - Fast-Forward and Tag
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Provide a tag name (e.g. v1.0.0)'
required: true
type: string
jobs:
ff-and-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'master'
- name: Merge Fast Forward
uses: MaximeHeckel/github-action-merge-fast-forward@v1.1.0
with:
branchtomerge: origin/develop
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create and Push Tag
run: |
git tag ${{ inputs.tag_name }}
git push origin ${{ inputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}