Skip to content

Commit

Permalink
ci: improve release preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Sep 4, 2024
1 parent 3e1e363 commit 049399e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 45 deletions.
15 changes: 3 additions & 12 deletions .github/actions/bump-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
name: "Bump version in gradle.properties"
description: "Increments the patch version of the version found in gradle.properties, appends -SNAPSHOT"
description: "Increments the minor version of the version found in gradle.properties, appends -SNAPSHOT"
inputs:
target_branch:
default: 'main'
description: "Branch on which the version bump is to be done."
required: false
base_version:
description: "The current version, which is to be bumped to the next snapshot"
required: false

runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: read version from gradle.properties
- name: bump current ${{ inputs.base_version }} version
shell: bash
run: |
# Prepare git env
git config user.name "eclipse-edc-bot"
git config user.email "[email protected]"
# checkout target
git fetch origin
git checkout ${{ inputs.target_branch }}
# use current version from input
baseVersion=${{ inputs.base_version }}
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
Expand Down Expand Up @@ -52,4 +43,4 @@ runs:
git add .
git commit --message "Bump version from $baseVersion to $newVersion [skip ci]"
git push origin ${{ inputs.target_branch }}
git push
20 changes: 0 additions & 20 deletions .github/workflows/bump-version.yaml

This file was deleted.

39 changes: 27 additions & 12 deletions .github/workflows/core-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,27 @@ jobs:
git push origin $RELEASE_REF
echo "RELEASE_REF=$RELEASE_REF" >> $GITHUB_OUTPUT
Publish-Snapshot:
Bump-Main-Version:
if: github.ref_name == 'main'
needs: [ Prepare-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.Prepare-Release.outputs.RELEASE_REF }}
ref: main
- uses: eclipse-edc/.github/.github/actions/bump-version@main
with:
base_version: ${{ inputs.version }}

Publish-Main-Snapshot:
# publish snapshot artifacts for the next x.y.0 version
if: github.ref_name == 'main'
needs: [ Bump-Main-Version ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main

- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
Expand All @@ -62,19 +76,20 @@ jobs:
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}

Bump-Main-Version:
if: github.ref_name == 'main'
Publish-Bugfix-Snapshot:
# publish snapshot artifacts from the bugfix branch (RELEASE_REF) only for bugfix releases (that does not start from main)
if: github.ref_name != 'main'
needs: [ Prepare-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/bump-version@main
with:
target_branch: main
base_version: ${{ inputs.version }}
ref: ${{ needs.Prepare-Release.outputs.RELEASE_REF }}

- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}

Publish-Main-Snapshot:
if: github.ref_name == 'main'
needs: [ Bump-Main-Version ]
uses: eclipse-edc/.github/.github/workflows/publish-snapshot.yml@main
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/technology-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/bump-version@main
with:
target_branch: main
base_version: ${{ needs.Create-Tag.outputs.VERSION }}

Post-To-Discord:
Expand Down

0 comments on commit 049399e

Please sign in to comment.