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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d6ced6e
Update update versions workflow to use aepsdk-commons reusable workflow
timkimadobe Oct 23, 2024
9386c93
Update maven release and snapshot workflows to use reusable workflows
timkimadobe Oct 24, 2024
260ff4c
Add workflow_tag input
timkimadobe Oct 24, 2024
c50df5d
Add pr permissions
timkimadobe Oct 24, 2024
4b873ea
Update config to prod
timkimadobe Oct 24, 2024
036833c
Apply testing config
timkimadobe Oct 24, 2024
a35eb5a
Revert "Apply testing config"
timkimadobe Oct 24, 2024
1f355bf
Update example versions to 1.2.3 for consistency
timkimadobe Oct 24, 2024
ded1168
Update input ordering for consistency
timkimadobe Oct 24, 2024
2b7b5c7
Update doc styling
timkimadobe Oct 24, 2024
e21e498
Fix tagged version used for update version workflow
timkimadobe Oct 25, 2024
f80795b
Add license header back to update version workflow
timkimadobe Oct 29, 2024
fd32eb0
Update update version workflow input descriptions to better describe …
timkimadobe Oct 29, 2024
07bd896
Update parameter name to latest
timkimadobe Oct 30, 2024
b44f528
Switch description multiline type
timkimadobe Oct 30, 2024
8739d7e
Remove default from mandatory fields to trigger error on empty submit
timkimadobe Oct 31, 2024
6bb8b95
Update to latest version of reusable workflow format
timkimadobe Oct 31, 2024
768a412
Apply testing config
timkimadobe Oct 31, 2024
4cbe66c
Update input descriptions
timkimadobe Oct 31, 2024
678b39b
Update to production tag
timkimadobe Nov 8, 2024
3f25594
Update to final production config
timkimadobe Nov 8, 2024
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
77 changes: 22 additions & 55 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,29 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
required: true

action_tag:
description: 'Create tag? ("no" to skip)'
description: 'The tag (version) to be released (ex: 1.2.3).'
type: string
required: true
default: 'yes'
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 }})
create-github-release:
description: 'Create GitHub release using tag. If the provided `tag` does not exist, it will be created.'
type: boolean
required: true
default: true

- 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
edge-identity-dependency:
description: 'The AEPEdgeIdentity dependency version in gradle.properties to be validated (ex: 1.2.3).'
type: string
required: true

- 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 }}
jobs:
publish:
permissions:
contents: write
uses: adobe/aepsdk-commons/.github/workflows/android-maven-release.yml@gha-android-3.0.0
with:
tag: ${{ github.event.inputs.tag }}
create-github-release: ${{ github.event.inputs.create-github-release == 'true' }}
version-validation-paths: code/gradle.properties, code/edge/src/main/java/com/adobe/marketing/mobile/EdgeConstants.java
version-validation-dependencies: AEPEdgeIdentity ${{ github.event.inputs.edge-identity-dependency }}
secrets: inherit
36 changes: 5 additions & 31 deletions .github/workflows/maven-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,12 @@
#

name: Publish Snapshot
on:
on:
workflow_dispatch:

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: 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 Snapshot Repository
run: make ci-publish-staging
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-snapshot.yml@gha-android-3.0.0
secrets: inherit
73 changes: 48 additions & 25 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,62 @@
# governing permissions and limitations under the License.
#

name: Update Version
name: Update Versions

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: 1.2.3).'
type: string
required: true

branch:
description: 'The target branch where the version update will be applied and the pull request will be merged into.'
type: string
required: true

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).
This is a published dependency in the pom.xml file.
type: string
required: false
default: ''

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

description: |
If a version is provided, update AEPEdgeIdentity dependency in gradle.properties (ex: 1.2.3).
This is a published dependency in the pom.xml file.
type: string
required: false
default: ''

edge-consent-dependency:
description: |
If a version is provided, update AEPEdgeConsent dependency in gradle.properties (ex: 1.2.3).
This is a testing-only dependency.
type: string
required: false
default: ''

identity-dependency:
description: '[Optional] Update Edge Identity dependency in pom.xml. Example: 3.0.0'
testutils-dependency:
description: |
If a version is provided, update AEPTestUtils dependency in gradle.properties (ex: 1.2.3).
This is a testing-only dependency.
type: string
required: false
default: ''

jobs:
update-version:
runs-on: ubuntu-latest

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 }}")

- 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 }}
update-versions:
permissions:
contents: write
pull-requests: write
uses: adobe/aepsdk-commons/.github/workflows/versions.yml@gha-android-3.0.0
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