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

Update GitHub Action workflows to use aepsdk-commons #171

Merged
merged 21 commits into from
Nov 8, 2024

Conversation

timkimadobe
Copy link
Contributor

@timkimadobe timkimadobe commented Oct 24, 2024

Description

This PR migrates the local GitHub Action workflows to use the reusable workflows available in aepsdk-commons. At a high level:

  • The reusable workflows are tagged per platform in aepsdk-commons (ex: gha-android-1.0.0), which the workflows use for controlling which version of the workflow is used
  • The same style of manual workflow inputs has been generally preserved, and the goal is to abstract away the usage of the reusable workflows

update-version.yml

  • The optional dependency list has expanded based on all of the existing dependencies in gradle.properties today

maven-release.yml

  • Edge Identity dependency version has been added as a validation requirement for the release

Note

Due to current GitHub Actions YAML limitations, YAML anchors are not available, meaning that the workflow tag and input value must be maintained simultaneously. However, they are planning on adding this in 2025.
Source: actions/runner#1182

Example job runs

Note

These runs were performed in my fork of the repo, also referencing the workflows in my fork of aepsdk-commons (to avoid cross-repo checkout token permission requirements)

Update versions (no dependencies):

Update versions (dependencies AND targeting different branch dev - demonstrating you can update versions in any branch):

Publish release (failed because no secrets for publishing available in fork):

Publish snapshot (failed because no secrets for publishing available in fork):

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@@ -15,62 +15,29 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
description: 'The existing tag (version) to be released (ex: 5.0.1).'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag will be created with the workflow, so "The existing tag ..." might sound confusing.

Copy link
Contributor Author

@timkimadobe timkimadobe Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release workflow is currently using the --verify-tag flag which:

Abort in case the git tag doesn't already exist in the remote repository
docs: https://cli.github.com/manual/gh_release_create

This is true for both iOS and Android release workflows - I was thinking it could be beneficial to make creating the release tag explicit, in order to avoid accidentally publishing unintended changes/branch states. What do you think?

See example release failure due to missing tag + this flag here: https://github.com/timkimadobe/aepsdk-edge-android/actions/runs/11507608386/job/32034124666

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression create GH release creates the tag and release. Isn't that the case?

default: true

edge-identity-dependency:
description: 'The AEPEdgeIdentity dependency version in gradle.properties to be validated (ex: 3.0.1).'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Here we use ex: 3.0.1 the L18 tag has ex: 5.0.1

let's keep example versions also consistent and probably to latest major version i.e. 3.x

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see 3.0.1 in rest of the PR so let's use 3.0.1 everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually what do you think about using a generic 1.2.3 everywhere instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works

@timkimadobe timkimadobe requested a review from addb October 24, 2024 21:22
Add code documentation to explicitly mention tags must match
@@ -1,48 +1,56 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the copyright header for this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Added back


core-dependency:
description: '[Optional] Update Core dependency in pom.xml. Example: 3.0.0'
description: 'If a version is provided, update AEPCore dependency in gradle.properties (ex: 1.2.3).'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify that this is a dependency in the pom.xml file, so users know this is a published dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Added the additional context to the description as suggested


identity-dependency:
description: '[Optional] Update Edge Identity dependency in pom.xml. Example: 3.0.0'
edge-identity-dependency:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify that this is a dependency in the pom.xm file, so users know this is a publish dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

update-version:
runs-on: ubuntu-latest
edge-consent-dependency:
description: 'If a version is provided, update AEPEdgeConsent dependency in gradle.properties (ex: 1.2.3).'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify this is a testing only dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

- name: Update Edge
run: (./scripts/version.sh -u -v ${{ github.event.inputs.version }} -d "Core ${{ github.event.inputs.core-dependency }}, EdgeIdentity ${{ github.event.inputs.identity-dependency }}")
testutils-dependency:
description: 'If a version is provided, update AEPTestUtils dependency in gradle.properties (ex: 1.2.3).'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify this is a testing only dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Contributor Author

@timkimadobe timkimadobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @kevinlind! Updated based on feedback

@@ -1,48 +1,56 @@
#
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Added back


core-dependency:
description: '[Optional] Update Core dependency in pom.xml. Example: 3.0.0'
description: 'If a version is provided, update AEPCore dependency in gradle.properties (ex: 1.2.3).'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Added the additional context to the description as suggested

update-version:
runs-on: ubuntu-latest
edge-consent-dependency:
description: 'If a version is provided, update AEPEdgeConsent dependency in gradle.properties (ex: 1.2.3).'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

- name: Update Edge
run: (./scripts/version.sh -u -v ${{ github.event.inputs.version }} -d "Core ${{ github.event.inputs.core-dependency }}, EdgeIdentity ${{ github.event.inputs.identity-dependency }}")
testutils-dependency:
description: 'If a version is provided, update AEPTestUtils dependency in gradle.properties (ex: 1.2.3).'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated


identity-dependency:
description: '[Optional] Update Edge Identity dependency in pom.xml. Example: 3.0.0'
edge-identity-dependency:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@timkimadobe timkimadobe requested a review from kevinlind October 29, 2024 23:11
@timkimadobe
Copy link
Contributor Author

Final checks using production tag (gha-android-3.0.0):

Update versions (with dependencies): timkimadobe/aepsdk-edge-ios#48

Snapshot: https://github.com/timkimadobe/aepsdk-edge-android/actions/runs/11750087816/job/32737627821

  • Fails due to missing GPG key

Release: https://github.com/timkimadobe/aepsdk-edge-android/actions/runs/11750418141/job/32738633511

  • Fails due to missing GPG key
  • Tag check has been updated to reflect Android style "v" prefix tags

@timkimadobe timkimadobe merged commit 11a391e into adobe:dev Nov 8, 2024
6 checks passed
@timkimadobe timkimadobe deleted the reusable-workflows branch November 27, 2024 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants