From 9f06ea227c30761236bb7be37d2df0ce50b790b1 Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Wed, 28 Aug 2024 13:50:40 +0200 Subject: [PATCH] ci: new release workflow --- .github/workflows/release-all-java.yml | 75 -------------------------- .github/workflows/release.yml | 10 ++++ 2 files changed, 10 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/release-all-java.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-all-java.yml b/.github/workflows/release-all-java.yml deleted file mode 100644 index 576dd2a4..00000000 --- a/.github/workflows/release-all-java.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Create Release for all Java Modules -on: - workflow_dispatch: - inputs: - metamodel_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: - METAMODEL_VERSION: ${{ github.event.inputs.metamodel_version || inputs.metamodel_version }} - -jobs: - Prepare-Release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - # create tag on the current branch using GitHub's own API - - name: Create tag on current branch (main) - uses: actions/github-script@v7 - with: - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'refs/tags/v${{ env.METAMODEL_VERSION }}', - sha: context.sha - }) - - # create merge commit main -> releases encoding the version in the commit message - - name: Merge main -> releases - uses: everlytic/branch-merge@1.1.5 - with: - github_token: ${{ github.token }} - source_ref: ${{ github.ref }} - target_branch: 'releases' - commit_message_template: 'Merge commit for release of version v${{ env.METAMODEL_VERSION }}' - - outputs: - metamodel-version: ${{ env.METAMODEL_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.metamodel-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.METAMODEL_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.metamodel-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.metamodel-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c6622e6b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,10 @@ +name: Release + +on: + workflow_dispatch: + workflow_call: + +jobs: + Release: + uses: eclipse-edc/.github/.github/workflows/core-release.yml@main + secrets: inherit