forked from eclipse-edc/Connector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Test Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: the branch from which the release will be created | ||
required: false | ||
type: string | ||
default: main | ||
version: | ||
description: the version number in the `x.y.z` form | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
Prepare-Release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: set release type | ||
shell: bash | ||
id: vars | ||
run: | | ||
type=release | ||
if [[ ${{ inputs.branch }} != "main" ]] | ||
then | ||
type=bugfix | ||
fi | ||
echo "type=$type" >> $GITHUB_OUTPUT | ||
- shell: bash | ||
run: | | ||
# updates the project version | ||
sed -i 's#^version=.*#version=${{ inputs.version }}#g' $(find . -name "gradle.properties") | ||
# updates the eventual core library version in the version catalog | ||
sed -i 's#^edc = .*#edc = "${{ inputs.version }}"#g' gradle/libs.versions.toml | ||
- name: Create branch | ||
run: | | ||
git config user.name "eclipse-edc-bot" | ||
git config user.email "[email protected]" | ||
git checkout -b prepare/${{ inputs.version }} | ||
git add . | ||
git commit -m "Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }}" | ||
git push -f origin prepare/${{ inputs.version }} | ||
- name: Create pull request | ||
uses: thomaseizinger/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
head: prepare/${{ inputs.version }} | ||
base: ${{ steps.vars.outputs.type }}/${{ inputs.version }} | ||
title: Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }} | ||
reviewers: ${{ github.actor }} | ||
body: |- | ||
This PR was created in response to a manual trigger of the prepare release. | ||
Versions have been bumped in to ${{ inputs.version }}. | ||
Merging this PR will create and run a release workflow | ||