-
Notifications
You must be signed in to change notification settings - Fork 11
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
Changes from 5 commits
d6ced6e
9386c93
260ff4c
c50df5d
4b873ea
036833c
a35eb5a
1f355bf
ded1168
2b7b5c7
e21e498
f80795b
fd32eb0
07bd896
b44f528
8739d7e
6bb8b95
768a412
4cbe66c
678b39b
3f25594
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,62 +15,29 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'tag/version' | ||
description: 'The existing tag (version) to be released (ex: 5.0.1).' | ||
required: true | ||
|
||
action_tag: | ||
description: 'Create tag? ("no" to skip)' | ||
create-github-release: | ||
description: 'Create GitHub release with tag? ("false" to skip)' | ||
type: boolean | ||
required: true | ||
default: 'yes' | ||
default: true | ||
|
||
edge-identity-dependency: | ||
description: 'The AEPEdgeIdentity dependency version in gradle.properties to be validated (ex: 3.0.1).' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually what do you think about using a generic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. works |
||
required: true | ||
type: string | ||
default: '' | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
- name: Verify version | ||
run: | | ||
set -eo pipefail | ||
echo Release version: ${{ github.event.inputs.tag }} | ||
(./scripts/version.sh -v ${{ github.event.inputs.tag }}) | ||
|
||
- name: Create GH Release | ||
id: create_release | ||
uses: release-drafter/release-drafter@v5 | ||
if: ${{ github.event.inputs.action_tag == 'yes' }} | ||
with: | ||
name: v${{ github.event.inputs.tag }} | ||
tag: v${{ github.event.inputs.tag }} | ||
version: v${{ github.event.inputs.tag }} | ||
publish: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Import GPG key | ||
env: | ||
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }} | ||
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }} | ||
run: | | ||
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes | ||
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes | ||
|
||
- name: Publish to Maven Central Repository | ||
run: make ci-publish | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
permissions: | ||
contents: write | ||
uses: adobe/aepsdk-commons/.github/workflows/android-maven-release.yml@gha-android-1.0.0 | ||
with: | ||
tag: ${{ github.event.inputs.tag }} | ||
create-github-release: ${{ github.event.inputs.create-github-release == 'true' }} | ||
version-verify-paths: code/gradle.properties, code/edge/src/main/java/com/adobe/marketing/mobile/EdgeConstants.java | ||
version-verify-dependencies: AEPEdgeIdentity ${{ github.event.inputs.edge-identity-dependency }} | ||
workflow_tag: gha-android-1.0.0 | ||
secrets: inherit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,54 @@ | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the copyright header for this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! Added back |
||
# Copyright 2024 Adobe. All rights reserved. | ||
# This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. You may obtain a copy | ||
# of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under | ||
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
# OF ANY KIND, either express or implied. See the License for the specific language | ||
# governing permissions and limitations under the License. | ||
# | ||
name: Update Versions | ||
|
||
name: Update Version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'New version to use for the Edge extension. Example: 3.0.0' | ||
version: | ||
description: 'New version to use for the extension (ex: 3.0.1).' | ||
required: true | ||
type: string | ||
default: '' | ||
|
||
branch: | ||
description: 'The target branch where the version update will be applied and the pull request will be merged into.' | ||
required: true | ||
type: string | ||
default: '' | ||
|
||
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: 3.0.1).' | ||
required: false | ||
type: string | ||
default: '' | ||
|
||
identity-dependency: | ||
description: '[Optional] Update Edge Identity dependency in pom.xml. Example: 3.0.0' | ||
edge-identity-dependency: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
description: 'If a version is provided, update AEPEdgeIdentity dependency in gradle.properties (ex: 3.0.1).' | ||
required: false | ||
type: string | ||
default: '' | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
edge-consent-dependency: | ||
description: 'If a version is provided, update AEPEdgeConsent dependency in gradle.properties (ex: 3.0.1).' | ||
required: false | ||
type: string | ||
default: '' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- 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: 3.0.1).' | ||
required: false | ||
type: string | ||
default: '' | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ github.token }} | ||
commit-message: Updating version to ${{ github.event.inputs.version }}. | ||
branch: version-${{ github.event.inputs.version }}-update | ||
delete-branch: true | ||
title: Updating version to ${{ github.event.inputs.version }} | ||
body: Updating version to ${{ github.event.inputs.version }} | ||
jobs: | ||
update-versions: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
uses: adobe/aepsdk-commons/.github/workflows/versions.yml@version-script-update | ||
with: | ||
version: ${{ github.event.inputs.version }} | ||
branch: ${{ github.event.inputs.branch }} | ||
dependencies: AEPCore ${{ github.event.inputs.core-dependency }}, AEPEdgeIdentity ${{ github.event.inputs.edge-identity-dependency }}, AEPEdgeConsent ${{ github.event.inputs.edge-consent-dependency }}, AEPTestUtils ${{ github.event.inputs.testutils-dependency }} | ||
cacheung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
paths: code/edge/src/main/java/com/adobe/marketing/mobile/EdgeConstants.java, code/gradle.properties | ||
update: true | ||
workflow_tag: gha-android-1.0.0 | ||
cacheung marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: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
There was a problem hiding this comment.
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?