Skip to content

Create Release of Technology-Aws #4

Create Release of Technology-Aws

Create Release of Technology-Aws #4

name: Create Release of Technology-Aws
on:
workflow_call:
inputs:
edc_version:
description: 'Version string that is used for publishing (e.g. "1.0.0", NOT "v1.0.0"). Appending -SNAPSHOT will create a snapshot release.'
required: true
type: string
workflow_dispatch:
inputs:
edc_version:
description: 'Version string that is used for publishing (e.g. "1.0.0", NOT "v1.0.0"). Appending -SNAPSHOT will create a snapshot release.'
required: true
type: string
env:
EDC_VERSION: ${{ github.event.inputs.edc_version || inputs.edc_version }}
jobs:
Prepare-Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize mandatory git config
run: |
git config user.name "eclipse-edc-bot"
git config user.email "[email protected]"
# create tag on the current branch using GitHub's own API
- name: Create tag on current branch (main)
run: |
git tag v${{ env.EDC_VERSION }}
# create merge commit main -> releases encoding the version in the commit message
- name: Merge main -> releases
run: |
git fetch origin --depth 1
git checkout --track origin/releases
git merge main -m "Merge commit for release of version v${{ env.EDC_VERSION }}"
git push origin releases
outputs:
edc-version: ${{ env.EDC_VERSION }}
Github-Release:
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job
if: ${{ !endsWith( needs.Prepare-Release.outputs.edc-version, '-SNAPSHOT') }}
needs:
- Prepare-Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
tag: "v${{ env.EDC_VERSION }}"
token: ${{ secrets.GITHUB_TOKEN }}
removeArtifacts: true
Bump-Version:
name: 'Update release version'
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job
if: ${{ !endsWith( needs.Prepare-Release.outputs.edc-version, '-SNAPSHOT') }}
needs: [ Prepare-Release, Github-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: ${{ needs.Prepare-Release.outputs.edc-version }}