diff --git a/.ci/release.sh b/.ci/release.sh index 841b9e6c7..4994b1625 100755 --- a/.ci/release.sh +++ b/.ci/release.sh @@ -123,10 +123,3 @@ if [[ "$target_specifier" == "all" || "$target_specifier" == "pluginPortal" ]]; fi fi set -x - -echo "--- Running post deploy process" -if [[ "$dry_run" == "true" ]] ; then - echo './gradlew postDeploy' -else - ./gradlew postDeploy $COMMON_GRADLE_CONFIG_PARAMS -fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adb820b7f..167d19310 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} pipeline: apm-agent-android-release - waitFor: false + waitFor: true printBuildLogs: false buildEnvVars: | branch_specifier=${{ inputs.branch_specifier || 'main' }} @@ -75,3 +75,25 @@ jobs: message: | :ghost: [${{ github.repository }}] Release *${{ github.ref_name }}* didn't get triggered in Buildkite. Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>) + post_release: + name: Post Release + needs: release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: elastic/apm-pipeline-library/.github/actions/github-token@current + with: + url: ${{ secrets.VAULT_ADDR }} + roleId: ${{ secrets.VAULT_ROLE_ID }} + secretId: ${{ secrets.VAULT_SECRET_ID }} + - uses: elastic/apm-pipeline-library/.github/actions/setup-git@current + with: + username: ${{ env.GIT_USER }} + email: ${{ env.GIT_EMAIL }} + token: ${{ env.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.branch_specifier || 'main' }} + token: ${{ env.GITHUB_TOKEN }} + - run: ./gradlew postDeploy -Prelease=true -Pversion_override=${{ inputs.version_override_specifier || '' }} diff --git a/agp-compatibility/agp-compatibility-7-2/metadata/notice.properties b/agp-compatibility/agp-compatibility-7-2/metadata/notice.properties index 1e6587315..c4167d836 100644 --- a/agp-compatibility/agp-compatibility-7-2/metadata/notice.properties +++ b/agp-compatibility/agp-compatibility-7-2/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:28:58 CEST 2023 -dependencies.hash=D41D8CD98F00B204E9800998ECF8427E +dependencies.hash=D41D8CD98F00B204E9800998ECF8427E \ No newline at end of file diff --git a/agp-compatibility/agp-compatibility-7-3/metadata/notice.properties b/agp-compatibility/agp-compatibility-7-3/metadata/notice.properties index 1e6587315..c4167d836 100644 --- a/agp-compatibility/agp-compatibility-7-3/metadata/notice.properties +++ b/agp-compatibility/agp-compatibility-7-3/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:28:58 CEST 2023 -dependencies.hash=D41D8CD98F00B204E9800998ECF8427E +dependencies.hash=D41D8CD98F00B204E9800998ECF8427E \ No newline at end of file diff --git a/agp-compatibility/agp-compatibility-api/metadata/notice.properties b/agp-compatibility/agp-compatibility-api/metadata/notice.properties index 1e6587315..c4167d836 100644 --- a/agp-compatibility/agp-compatibility-api/metadata/notice.properties +++ b/agp-compatibility/agp-compatibility-api/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:28:58 CEST 2023 -dependencies.hash=D41D8CD98F00B204E9800998ECF8427E +dependencies.hash=D41D8CD98F00B204E9800998ECF8427E \ No newline at end of file diff --git a/android-common/metadata/notice.properties b/android-common/metadata/notice.properties index 96df27d17..e23aed6db 100644 --- a/android-common/metadata/notice.properties +++ b/android-common/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:28:58 CEST 2023 -dependencies.hash=C4E938CB5D2FBDF87B030546B2E27163 +dependencies.hash=C4E938CB5D2FBDF87B030546B2E27163 \ No newline at end of file diff --git a/android-instrumentation/metadata/notice.properties b/android-instrumentation/metadata/notice.properties index 92c58414a..13002a015 100644 --- a/android-instrumentation/metadata/notice.properties +++ b/android-instrumentation/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:29:01 CEST 2023 -dependencies.hash=A3B09917BB285EF396AF771F4773CA88 +dependencies.hash=A3B09917BB285EF396AF771F4773CA88 \ No newline at end of file diff --git a/android-plugin/metadata/notice.properties b/android-plugin/metadata/notice.properties index ea89a9fab..5e1fcd6df 100644 --- a/android-plugin/metadata/notice.properties +++ b/android-plugin/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:28:58 CEST 2023 -dependencies.hash=0DD08B094996DCF2A76E9BDCF6AAD579 +dependencies.hash=0DD08B094996DCF2A76E9BDCF6AAD579 \ No newline at end of file diff --git a/android-sdk-ktx/metadata/notice.properties b/android-sdk-ktx/metadata/notice.properties index bc94c145e..8e601e20c 100644 --- a/android-sdk-ktx/metadata/notice.properties +++ b/android-sdk-ktx/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:28:58 CEST 2023 -dependencies.hash=10B02FCF3F89AE2FB4C10F150B4D3E60 +dependencies.hash=10B02FCF3F89AE2FB4C10F150B4D3E60 \ No newline at end of file diff --git a/android-sdk/metadata/notice.properties b/android-sdk/metadata/notice.properties index c2c5b9cdb..436e98f4f 100644 --- a/android-sdk/metadata/notice.properties +++ b/android-sdk/metadata/notice.properties @@ -1,2 +1 @@ -#Wed Jun 14 11:05:10 CEST 2023 -dependencies.hash=E031E675FDFA0A70B2D4701CBDC88E2E +dependencies.hash=E031E675FDFA0A70B2D4701CBDC88E2E \ No newline at end of file diff --git a/build-tools/src/main/java/co/elastic/apm/compile/tools/metadata/NoticeMetadataHandler.java b/build-tools/src/main/java/co/elastic/apm/compile/tools/metadata/NoticeMetadataHandler.java index d03502bae..601d26f72 100644 --- a/build-tools/src/main/java/co/elastic/apm/compile/tools/metadata/NoticeMetadataHandler.java +++ b/build-tools/src/main/java/co/elastic/apm/compile/tools/metadata/NoticeMetadataHandler.java @@ -5,10 +5,9 @@ import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.util.Properties; public class NoticeMetadataHandler { @@ -47,8 +46,8 @@ public void setDependenciesHash(String dependenciesHash) { } public void save(File output) { - try (OutputStream out = new FileOutputStream(output)) { - properties.store(out, null); + try (FileWriter writer = new FileWriter(output, false)) { + writer.write(PROPERTY_DEPENDENCIES_HASH + "=" + getDependenciesHash()); } catch (IOException e) { throw new RuntimeException(e); } diff --git a/build-tools/src/main/java/co/elastic/apm/compile/tools/publishing/tasks/PostDeployTask.java b/build-tools/src/main/java/co/elastic/apm/compile/tools/publishing/tasks/PostDeployTask.java index 8ac311803..bcb909cee 100644 --- a/build-tools/src/main/java/co/elastic/apm/compile/tools/publishing/tasks/PostDeployTask.java +++ b/build-tools/src/main/java/co/elastic/apm/compile/tools/publishing/tasks/PostDeployTask.java @@ -46,10 +46,13 @@ public void execute() { updateChangelog(currentVersion); publishChanges(); + log("Finished the post deploy task successfully"); } private void publishChanges() { + log("Committing changes"); runCommand("git commit -a -m \"Preparing for the next release\""); + log("Pushing changes"); runCommand("git push"); } @@ -66,6 +69,7 @@ private void updateNextVersion(File gradlePropertiesFile, Properties properties, } private void updateChangelog(String newVersion) { + log("Updating changelog with version: " + newVersion); Path changelogPath = getChangelogPath(); String contents = getContents(changelogPath); contents = uncommentNextRelease(contents);