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 11 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
81 changes: 26 additions & 55 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,33 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
required: true
description: 'The existing tag (version) to be released (ex: 1.2.3).'
type: string
required: true
default: ''

create-github-release:
description: 'Create GitHub release using tag (`false` to skip).'
type: boolean
required: true
default: true

action_tag:
description: 'Create tag? ("no" to skip)'
edge-identity-dependency:
description: 'The AEPEdgeIdentity dependency version in gradle.properties to be validated (ex: 1.2.3).'
type: string
required: true
default: 'yes'
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
# @<workflow-version-tag> refers to the tag (version) of the reusable workflow in the aepsdk-commons repository.
# When updating the tag here, the `workflow_tag` input to the workflow must match this value.
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 # This tag must match the tag used for the reusable workflow.
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-1.0.0
secrets: inherit
78 changes: 43 additions & 35 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -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

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

branch:
description: 'The target branch where the version update will be applied and the pull request will be merged into.'
type: string
required: true
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: 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

type: string
required: false
default: ''

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

description: 'If a version is provided, update AEPEdgeIdentity dependency in gradle.properties (ex: 1.2.3).'
type: string
required: false
default: ''

jobs:
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

type: string
required: false
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: 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

type: string
required: false
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
# @<workflow-version-tag> refers to the tag (version) of the reusable workflow in the aepsdk-commons repository.
# When updating the tag here, the `workflow_tag` input to the workflow must match this value.
uses: adobe/aepsdk-commons/.github/workflows/versions.yml@gha-android-1.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
workflow_tag: gha-android-1.0.0 # This tag must match the tag used for the reusable workflow.