Skip to content

Commit

Permalink
build: add prepare release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Aug 27, 2024
1 parent d6e3561 commit 3054444
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Prepare release

on:
workflow_dispatch:
inputs:
version:
description: Semantic Version string to use for this release
required: true
branch:
description: Source ranch from which the version should be created. If omitted, 'main' is used. Please note that the branch should be available in all the core repositories.
required: false
default: main

jobs:
prepare:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
repository: [ "runtime-metamodel", "gradleplugins", "connector", "identityhub", "federatedcatalog" ]

steps:
- uses: actions/checkout@v4
- name: "Prepare release ${{ matrix.repos.name }}"
run: |
chmod +x ./scripts/github_action.sh
./scripts/github_action.sh
"eclipse-edc" \
"${{ matrix.repository }}" \
"prepare-release.yml" \
"{\"version\": \"${{ inputs.version }}\"}" \
"${{ secrets.ORG_GITHUB_BOT_USER }}" \
"${{ secrets.ORG_GITHUB_BOT_TOKEN }}" \
"${{ inputs.branch }}"
notify:
needs: [ prepare ]
if: always()
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
name: "Notify on discord"
with:
webhook: ${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}
# if the publishing is skipped, that means the preceding test run failed
status: ${{ needs.prepare.result }}
title: "Release preparation"
description: "Prepare release ${{ inputs.version }}"
username: GitHub Actions
15 changes: 8 additions & 7 deletions prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ dependencyResolutionManagement {
create("identityhub") {
from("org.eclipse.edc:identity-hub-versions:$VERSION")
}
// Commented because RegistrationService has been excluded from the build
// create("registrationservice") {
// from("org.eclipse.edc:registration-service-versions:$VERSION")
// }
create("federatedcatalog") {
from("org.eclipse.edc:federated-catalog-versions:$VERSION")
}
Expand Down Expand Up @@ -99,13 +95,18 @@ done
# if the version variable is set, set it in the various gradle.properties and settings.gradle.kts files, otherwise leave the old version
if [ -n "$VERSION" ]
then
# TODO: new release process:
# set the project version
# ...
# set the edc dependency version
# ...
# the rows until the end of the if branch can be removed then

# read the old version from the Connector's gradle.properties
oldVersion=$(grep "version" Connector/gradle.properties | awk -F= '{print $2}')
sed -i "s#$oldVersion#$VERSION#g" $(find . -name "gradle.properties")
sed -i "s#$oldVersion#$VERSION#g" $(find . -name "settings.gradle.kts")
sed -i "s#$oldVersion#$VERSION#g" $(find . -name "libs.versions.toml")
# sets version in GradlePlugins/DefaultDependencyConvention and in ConnectorServiceImpl (there should be a better way)
sed -i "s#$oldVersion#$VERSION#g" $(find . -name "*.java")
sed -i "s#$oldVersion#$VERSION#g" $(find . -name "settings.gradle.kts")
fi

# prebuild and publish plugins and modules to local repository, this needed to permit the all-in-one publish later
Expand Down

0 comments on commit 3054444

Please sign in to comment.