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

Improvement in cleaning mock releases #135

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
182782a
workflow logs
wojciech-piotrowiak Nov 8, 2023
c32ec10
disabling activiti-cloud-full-chart
wojciech-piotrowiak Nov 8, 2023
d2df342
enabling activiti-cloud-full-chart
wojciech-piotrowiak Nov 8, 2023
f6daf57
different log message+catching problems with removal
wojciech-piotrowiak Nov 8, 2023
f7f1302
different log message+catching problems with removal
wojciech-piotrowiak Nov 8, 2023
9786b74
no depth
wojciech-piotrowiak Nov 8, 2023
a4f129d
cd
wojciech-piotrowiak Nov 8, 2023
d586366
bot added
wojciech-piotrowiak Nov 8, 2023
42f6d44
different approach
wojciech-piotrowiak Nov 8, 2023
5475d5e
refactor
wojciech-piotrowiak Nov 8, 2023
16ee16b
refactor
wojciech-piotrowiak Nov 8, 2023
e6c9da6
format
wojciech-piotrowiak Nov 8, 2023
d89334f
typo
wojciech-piotrowiak Nov 8, 2023
052a841
fix
wojciech-piotrowiak Nov 8, 2023
e5b77fe
fix
wojciech-piotrowiak Nov 8, 2023
9e5333b
fix
wojciech-piotrowiak Nov 8, 2023
32909ef
fix
wojciech-piotrowiak Nov 8, 2023
bbc20ac
post checkout
wojciech-piotrowiak Nov 8, 2023
cc36d46
refactor
wojciech-piotrowiak Nov 8, 2023
3e95a3b
better logs+pinning
wojciech-piotrowiak Nov 8, 2023
e2ade1d
fail safe to false, reorder
wojciech-piotrowiak Nov 8, 2023
3d357f7
extra check
wojciech-piotrowiak Nov 8, 2023
0f0c076
repo activiti-scripts added to matrix responsible for creating gh rel…
wojciech-piotrowiak Nov 8, 2023
99b075a
Apply suggestions from code review
wojciech-piotrowiak Nov 10, 2023
51122cb
logs fix
wojciech-piotrowiak Nov 10, 2023
2d4aeec
Update .github/actions/remove-mock-release-and-tag/action.yml
wojciech-piotrowiak Nov 15, 2023
6cba7ef
double echo removed
wojciech-piotrowiak Nov 15, 2023
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
55 changes: 55 additions & 0 deletions .github/actions/remove-mock-release-and-tag/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Mock release cleanup
wojciech-piotrowiak marked this conversation as resolved.
Show resolved Hide resolved
description: Remove mock release and tag on a repository
inputs:
version:
description: Mock release version to be removed from tags and releases (should end with -mock)
required: true
repo:
description: Path the repository
required: true
gh-token:
description: 'GitHub Token'
required: true
runs:
using: composite
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
repository: ${{ inputs.repo }}
token: ${{ inputs.gh-token }}

- uses: Alfresco/alfresco-build-tools/.github/actions/git-check-existing-tag@34b2301fc6245fa98ed73a82e04d4f9ab4eb5a3f #v3.6.0
id: check-tag
with:
tag: ${{ inputs.version }}

- name: Delete tag if it exist and ends with "-mock"
if: steps.check-tag.outputs.exists == 'true'
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.gh-token }}
VERSION: ${{ inputs.version }}
run: |
if [[ "${VERSION}" == *-mock ]]; then
wojciech-piotrowiak marked this conversation as resolved.
Show resolved Hide resolved
echo "Removing '${VERSION}' tag from: ${REPO}"
git push origin --delete ${VERSION} || true
else
echo "Error: The provided version does not end with '-mock.'"
exit 1
fi

- name: Delete release if the provided version ends with "-mock"
id: delete_version
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.gh-token }}
VERSION: ${{ inputs.version }}
REPO: ${{ inputs.repo }}
run: |
if [[ "${VERSION}" == *-mock ]]; then
echo "Removing '${VERSION}' release from: ${REPO}"
gh release delete -R ${REPO} -y ${VERSION}
else
echo "Error: The provided version does not end with '-mock.'"
exit 1
fi
35 changes: 15 additions & 20 deletions .github/workflows/mock-release-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,19 @@ on:
jobs:
delete_version:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
repository: [ 'Activiti/activiti-cloud-full-chart',
'Activiti/activiti-scripts',
'Activiti/activiti-cloud',
'Activiti/activiti-cloud-common-chart',
'Activiti/activiti' ]
steps:
- name: Delete version if the provided version ends with "-mock"
id: delete_version
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
REPO: ${{ inputs.repository }}
VERSION: ${{ inputs.version }}
run: |
if [[ "${VERSION}" == *-mock ]]; then
gh release delete -R Activiti/activiti-cloud-full-chart -y --cleanup-tag ${VERSION}
gh release delete -R Activiti/activiti-scripts -y --cleanup-tag ${VERSION}
gh release delete -R Activiti/activiti-cloud -y --cleanup-tag ${VERSION}
gh release delete -R Activiti/activiti-cloud-common-chart -y --cleanup-tag ${VERSION}
gh release delete -R Activiti/Activiti -y --cleanup-tag ${VERSION}

else
echo "version does not end with '-mock'."
echo "Error: The provided version does not end with '-mock.'"
exit 1
fi
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: ./.github/actions/remove-mock-release-and-tag
with:
version: ${{ inputs.version }}
repo: ${{ matrix.repository }}
gh-token: ${{ secrets.BOT_GITHUB_TOKEN }}
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
1 change: 1 addition & 0 deletions .github/workflows/run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ jobs:
- activiti-cloud
- activiti-cloud-common-chart
- activiti-cloud-full-chart
- activiti-scripts
wojciech-piotrowiak marked this conversation as resolved.
Show resolved Hide resolved
env:
VERSION: ${{ needs.load-release-info.outputs.version }}
NOTES_START_TAG: ${{ needs.load-release-info.outputs.notes-start-tag }}
Expand Down