From e6e78a3cb1dbcecd29ad6b7a1ea93e6ac609f9b0 Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Wed, 14 Aug 2024 16:46:05 +0200 Subject: [PATCH] build: add prepare and release workflows --- .github/workflows/prepare-release.yml | 16 +++++++++ .github/workflows/publish.yaml | 50 ++++---------------------- .github/workflows/release.yml | 10 ++++++ .github/workflows/test-repo-split.yaml | 38 -------------------- 4 files changed, 33 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/prepare-release.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/test-repo-split.yaml diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 00000000..5e11c52a --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,16 @@ +name: Prepare Release + +on: + workflow_dispatch: + inputs: + version: + description: the version to be released. If it ends with '.0' a proper release is created, bugfix otherwise + required: true + type: string + +jobs: + Prepare-Release: + uses: eclipse-edc/.github/.github/workflows/technology-prepare-release.yml@main + secrets: inherit + with: + version: ${{ inputs.version }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index d6710651..c0f22939 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: Semantic Version string to use for this nightly build + description: Semantic Version string to use for this nightly build. It should ends with `-SNAPSHOT`. If not, please take a look at the release workflow. required: false schedule: - cron: "0 3 * * *" # run at 03:00 UTC @@ -58,50 +58,14 @@ jobs: needs: [ Secrets-Presence, Run-Tests, Determine-Version ] if: | needs.Secrets-Presence.outputs.HAS_OSSRH - steps: - - uses: actions/checkout@v4 - - uses: eclipse-edc/.github/.github/actions/setup-build@main - - # Import GPG Key - - uses: eclipse-edc/.github/.github/actions/import-gpg-key@main - if: | - needs.Secrets-Presence.outputs.HAS_OSSRH - name: "Import GPG Key" + - uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main with: + version: ${{ needs.Determine-Version.outputs.VERSION }} gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }} - - - name: Set correct version - env: - VERSION: ${{ needs.Determine-Version.outputs.VERSION }} - run: | - existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}') - grep -rlz "$existingVersion" . --exclude=\*.{sh,bin} | xargs sed -i "s/$existingVersion/$VERSION/g" - - - name: "Publish To OSSRH/MavenCentral" - if: | - needs.Secrets-Presence.outputs.HAS_OSSRH - env: - OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} - OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} - VERSION: ${{ needs.Determine-Version.outputs.VERSION }} - run: |- - cmd="" - if [[ $VERSION != *-SNAPSHOT ]] - then - cmd="closeAndReleaseSonatypeStagingRepository"; - fi - echo "Publishing Version $VERSION to Sonatype" - ./gradlew publishToSonatype ${cmd} --no-parallel -Pversion=$VERSION -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.ORG_GPG_PASSPHRASE }}" - - - # If we have a release version, also invoke the GH release job, bump versions, etc. - Create-GitHub-Release: - needs: [ Publish-Artefacts, Determine-Version ] - if: ${{ !endsWith(needs.Determine-Version.outputs.VERSION, '-SNAPSHOT') }} - uses: ./.github/workflows/release-tech-aws.yml - with: - edc_version: ${{ needs.Determine-Version.outputs.VERSION }} + gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }} + osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }} + osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }} Post-To-Discord: needs: [ Publish-Artefacts, Determine-Version, Secrets-Presence ] @@ -116,4 +80,4 @@ jobs: status: ${{ needs.Publish-Components.result == 'skipped' && 'Failure' || needs.Publish-Artefacts.result }} title: "Release Build Technology AWS" description: "Build and publish ${{ needs.Determine-Version.outputs.VERSION }}" - username: GitHub Actions \ No newline at end of file + username: GitHub Actions diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..66f17fb6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,10 @@ +name: Release + +on: + workflow_dispatch: + + +jobs: + Release: + uses: eclipse-edc/.github/.github/workflows/technology-release.yml@main + secrets: inherit diff --git a/.github/workflows/test-repo-split.yaml b/.github/workflows/test-repo-split.yaml deleted file mode 100644 index 5d90b12e..00000000 --- a/.github/workflows/test-repo-split.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# this workflow is only for testing and will be removed later! - -name: Test Repo Split workflows - -on: - workflow_dispatch: - inputs: - version: - description: Semantic Version string to use for this nightly build - required: false - -env: - INPUT_VERSION: ${{ github.event.inputs.version || inputs.version }} - - -#concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: true - -jobs: - Determine-Version: - # this looks to be necessary because some constructs as "with" are not able to get values from env - runs-on: ubuntu-latest - outputs: - VERSION: ${{ steps.get-version.outputs.VERSION }} - steps: - - name: "Extract version" - id: get-version - run: echo "VERSION=${{ env.INPUT_VERSION }}" >> "$GITHUB_OUTPUT" - - publish: - uses: paullatzelsperger/.github-edc/.github/workflows/publish-technology.yaml@main - needs: [Determine-Version] - with: - version: ${{ needs.Determine-Version.outputs.VERSION }} - component_release_workflow_file: "release-tech-aws.yaml" - component_test_workflow_file: "verify.yaml" - secrets: inherit \ No newline at end of file