From 0f7d205107e3e97335e283f81baeb44e20cfd028 Mon Sep 17 00:00:00 2001 From: jamshale Date: Mon, 22 Apr 2024 15:20:11 -0700 Subject: [PATCH] Update origin / Refactor / Comments Signed-off-by: jamshale --- .github/workflows/ReleaseWorkflows.md | 3 +-- .github/workflows/create-release-pr.yaml | 2 +- .github/workflows/create-release.yaml | 26 ++++++++++++++++-------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ReleaseWorkflows.md b/.github/workflows/ReleaseWorkflows.md index 2cd5d0089..31f66d1be 100644 --- a/.github/workflows/ReleaseWorkflows.md +++ b/.github/workflows/ReleaseWorkflows.md @@ -32,8 +32,7 @@ title: Create Release Workflow flowchart TB Start[Create Release] --> OnPushMain[On Push to Main] - OnPushMain --> GetACAPYRelease[Get latest ACA-PY Release via PIP] - GetACAPYRelease --> CheckChangeSet{Check ACAPY Version in Change Set} + OnPushMain --> CheckChangeSet{Check ACAPY Version in Change Set} CheckChangeSet --> |No updated lock files| End CheckChangeSet --> |Updated lock files| ConfigureGit[Configure Git] ConfigureGit --> GetReleaseTags[Get Release Tags - Based on ACA-PY Version] diff --git a/.github/workflows/create-release-pr.yaml b/.github/workflows/create-release-pr.yaml index dc949e6a3..85f1e2cf7 100644 --- a/.github/workflows/create-release-pr.yaml +++ b/.github/workflows/create-release-pr.yaml @@ -267,7 +267,7 @@ jobs: git config --global user.name 'Release Bot' git config --global user.email 'release-bot@users.noreply.github.com' - git remote set-url --push origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/jamshale/aries-acapy-plugins + git remote set-url --push origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/hyperledger/aries-acapy-plugins git fetch --all git checkout -b "release-v$release_version" diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 0e1754c04..150aafb28 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -15,7 +15,6 @@ jobs: permissions: write-all runs-on: ubuntu-latest outputs: - current_available_version: ${{ steps.current_available_version.outputs.version }} should_create_release: ${{ steps.should_create_release.outputs.should_create_release }} defaults: run: @@ -24,16 +23,15 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Get latest aries-cloudagent version - id: current_available_version - run: | - remote_version=$(pip index versions aries-cloudagent) - version=$(grep -oP '(?<=Available versions: ).*?(?=,)' <<< "$remote_version") - echo current_available_version=$version >> $GITHUB_OUTPUT - echo "Remote version = $version" + # ---------------------------------------------- + # Install Python + # ---------------------------------------------- - uses: actions/setup-python@v5 with: python-version: '3.9' + # ---------------------------------------------- + # Check if a release should be created + # ---------------------------------------------- - name: Check If Release Should Be Created id: should_create_release run: | @@ -45,6 +43,9 @@ jobs: echo "${upgraded_plugins}" + # Check if any of the changed files are poetry.lock files + # and if they not match the global poetry.lock file + for file in ${get_changed_files}; do if [[ $file == *"/poetry.lock"* ]] && [[ $file != *"integration/poetry.lock"* ]]; then for plugin in ${upgraded_plugins}; do @@ -63,6 +64,9 @@ jobs: echo "No Upgrade Detected. Skipping Release Creation." fi echo should_create_release=$found_upgrade >> $GITHUB_OUTPUT + # ---------------------------------------------- + # Create Release + # ---------------------------------------------- - name: Create Release if: steps.should_create_release.outputs.should_create_release == 'true' env: @@ -75,9 +79,11 @@ jobs: git config --global user.name 'Release Bot' git config --global user.email 'release-bot@users.noreply.github.com' - git remote set-url --push origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/jamshale/aries-acapy-plugins + git remote set-url --push origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/hyperledger/aries-acapy-plugins git fetch --tags + # Determine the release tag + get_tags_output=$(git tag -n0 "*$version*") echo "Tag output:" echo "${get_tags_output}" @@ -97,6 +103,8 @@ jobs: release_tag="$version.$tags_num" fi + # Get the release notes + body=$(python repo_manager.py 4) details="Plugins upgraded this release: "