BOM Update Dependencies #171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: BOM Update Dependencies | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '00 00 * * 2,4' | |
# At 00:00 on Tuesday and Thursday | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
update-bom: | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.1.0 | |
with: | |
ref: main | |
- name: Check existing PRs | |
run: | | |
if gh pr list --repo https://github.com/adobe/aepsdk-commons --json title | grep '\[CI\] updating BOM to'; then | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
else | |
echo "Not found existing PRs" | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Read bomVersion from gradle.properties | |
id: read_bomVersion_before | |
uses: christian-draeger/read-properties@1.1.1 | |
with: | |
path: './android/aepsdk-bom/gradle.properties' | |
properties: 'bomVersion' | |
- name: Generate BOM release notes | |
run: make -C android/aepsdk-bom generate-bom-release-notes | |
- name: Bump up BOM version and update extension versions | |
run: make -C android/aepsdk-bom bump-bom-version-and-update-bom-properties | |
- name: Set env (BOM_VERSION) | |
run: echo BOM_VERSION=$(grep "^bomVersion=" ./android/aepsdk-bom/gradle.properties | sed -e 's/.*=//') >> $GITHUB_ENV | |
- name: Print the new BOM version | |
run: echo ${{ env.BOM_VERSION }} | |
- name: Generate POM file | |
run: make -C android/aepsdk-bom generate-bom-pom | |
- name: Print the new POM | |
run: | | |
sudo apt-get install libxml2-utils | |
make -C android/aepsdk-bom print-bom-pom | |
continue-on-error: true | |
- name: Read bomVersion from gradle.properties | |
id: read_bomVersion_after | |
uses: christian-draeger/read-properties@1.1.1 | |
with: | |
path: './android/aepsdk-bom/gradle.properties' | |
properties: 'bomVersion' | |
- name: BOM versions | |
run: | | |
echo before: ${{ steps.read_bomVersion_before.outputs.bomVersion }} | |
echo after: ${{ steps.read_bomVersion_after.outputs.bomVersion }} | |
- name: Check BOM version | |
if: ${{ steps.read_bomVersion_before.outputs.bomVersion == steps.read_bomVersion_after.outputs.bomVersion }} | |
run: | | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4.2.3 | |
with: | |
token: ${{ github.token }} | |
commit-message: Updating BOM to ${{ env.BOM_VERSION }} | |
branch: ci-bom-${{ env.BOM_VERSION }}-update | |
delete-branch: true | |
labels: | | |
bom | |
automated pr | |
assignees: | | |
yangyansong-adbe | |
praveek | |
title: "[CI] updating BOM to ${{ env.BOM_VERSION }}" | |
body: Updating BOM to ${{ env.BOM_VERSION }} |