Skip to content

Commit

Permalink
Add workflows for version change
Browse files Browse the repository at this point in the history
  • Loading branch information
mk868 committed Nov 5, 2024
1 parent cce3ab0 commit c5dc7bf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Prepare Release

on:
workflow_dispatch:
Expand All @@ -22,16 +22,18 @@ jobs:
java-version: '23'
distribution: 'temurin'
cache: maven
- name: Set release version

- name: Set release version
run: |
mvn -B -ntp -f jgpio/pom.xml versions:set -DnewVersion=${{ github.event.inputs.version }}
mvn -B -ntp -f jgpio-it/pom.xml versions:set -DnewVersion=${{ github.event.inputs.version }}
mvn -B -ntp -f examples/pom.xml versions:set-property -Dproperty=jgpio.version -DnewVersion=${{ github.event.inputs.version }}
mvn -B -ntp -f jgpio/pom.xml versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
mvn -B -ntp -f jgpio-it/pom.xml versions:set -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
mvn -B -ntp -f examples/pom.xml versions:set-property -Dproperty=jgpio.version -DnewVersion=${{ github.event.inputs.version }} -DgenerateBackupPoms=false
sed -i '/<version>/s/>.*</>${{ github.event.inputs.version }}</' README.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'Release ${{ github.event.inputs.version }}'
title: 'Prepare release ${{ github.event.inputs.version }}'
body: 'Automated preparation of ${{ github.event.inputs.version }} release'
commit-message: 'Set version to ${{ github.event.inputs.version }}'
branch: 'release-${{ github.event.inputs.version }}'
37 changes: 37 additions & 0 deletions .github/workflows/prepare-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Prepare SNAPSHOT

on:
workflow_dispatch:
inputs:
version:
description: 'Next version (-SNAPSHOT will be added automatically)'
required: true

jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
cache: maven

- name: Set release version
run: |
mvn -B -ntp -f jgpio/pom.xml versions:set -DnewVersion=${{ github.event.inputs.version }}-SNAPSHOT -DgenerateBackupPoms=false
mvn -B -ntp -f jgpio-it/pom.xml versions:set -DnewVersion=${{ github.event.inputs.version }}-SNAPSHOT -DgenerateBackupPoms=false
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: 'Prepare ${{ github.event.inputs.version }}-SNAPSHOT'
body: 'Automated preparation of ${{ github.event.inputs.version }}-SNAPSHOT'
commit-message: 'Set version to ${{ github.event.inputs.version }}-SNAPSHOT'
branch: 'snapshot-${{ github.event.inputs.version }}-SNAPSHOT'

0 comments on commit c5dc7bf

Please sign in to comment.