Files
dirigent-spring/.github/workflows/publish.yml
T
2025-10-06 17:34:04 +02:00

56 lines
1.5 KiB
YAML

name: Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version number (z.B. 1.2.3)'
required: true
jobs:
update-and-tag:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Tags werden benötigt
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
- name: Update pom.xml version
working-directory: ./backend
run: mvn versions:set -DnewVersion=${{ github.event.inputs.version }}
- name: Update package.json version
working-directory: ./frontend
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version
- name: Install npm dependencies
working-directory: ./frontend
run: npm install
- name: Commit and push changes
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add ./backend/pom.xml ./frontend/package.json ./frontend/package-lock.json
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push
- name: Create and push tag
run: |
git tag v${{ github.event.inputs.version }}
git push origin v${{ github.event.inputs.version }}