Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating cicd #169

Merged
merged 16 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 23 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down Expand Up @@ -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 || '' }}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:28:58 CEST 2023
dependencies.hash=D41D8CD98F00B204E9800998ECF8427E
dependencies.hash=D41D8CD98F00B204E9800998ECF8427E
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:28:58 CEST 2023
dependencies.hash=D41D8CD98F00B204E9800998ECF8427E
dependencies.hash=D41D8CD98F00B204E9800998ECF8427E
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:28:58 CEST 2023
dependencies.hash=D41D8CD98F00B204E9800998ECF8427E
dependencies.hash=D41D8CD98F00B204E9800998ECF8427E
3 changes: 1 addition & 2 deletions android-common/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:28:58 CEST 2023
dependencies.hash=C4E938CB5D2FBDF87B030546B2E27163
dependencies.hash=C4E938CB5D2FBDF87B030546B2E27163
3 changes: 1 addition & 2 deletions android-instrumentation/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:29:01 CEST 2023
dependencies.hash=A3B09917BB285EF396AF771F4773CA88
dependencies.hash=A3B09917BB285EF396AF771F4773CA88
3 changes: 1 addition & 2 deletions android-plugin/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:28:58 CEST 2023
dependencies.hash=0DD08B094996DCF2A76E9BDCF6AAD579
dependencies.hash=0DD08B094996DCF2A76E9BDCF6AAD579
3 changes: 1 addition & 2 deletions android-sdk-ktx/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:28:58 CEST 2023
dependencies.hash=10B02FCF3F89AE2FB4C10F150B4D3E60
dependencies.hash=10B02FCF3F89AE2FB4C10F150B4D3E60
3 changes: 1 addition & 2 deletions android-sdk/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#Wed Jun 14 11:05:10 CEST 2023
dependencies.hash=E031E675FDFA0A70B2D4701CBDC88E2E
dependencies.hash=E031E675FDFA0A70B2D4701CBDC88E2E
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand All @@ -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);
Expand Down