Skip to content

Commit a35fbec

Browse files
chore(version): update version logic in Prowler (#4689)
Co-authored-by: Sergio Garcia <[email protected]> Co-authored-by: Sergio <[email protected]>
1 parent 11ca3b5 commit a35fbec

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

.github/workflows/build-lint-push-containers.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: ubuntu-latest
4444
outputs:
4545
prowler_version_major: ${{ steps.get-prowler-version.outputs.PROWLER_VERSION_MAJOR }}
46-
prowler_version: ${{ steps.update-prowler-version.outputs.PROWLER_VERSION }}
46+
prowler_version: ${{ steps.get-prowler-version.outputs.PROWLER_VERSION }}
4747
env:
4848
POETRY_VIRTUALENVS_CREATE: "false"
4949

@@ -65,6 +65,8 @@ jobs:
6565
id: get-prowler-version
6666
run: |
6767
PROWLER_VERSION="$(poetry version -s 2>/dev/null)"
68+
echo "PROWLER_VERSION=${PROWLER_VERSION}" >> "${GITHUB_ENV}"
69+
echo "PROWLER_VERSION=${PROWLER_VERSION}" >> "${GITHUB_OUTPUT}"
6870
6971
# Store prowler version major just for the release
7072
PROWLER_VERSION_MAJOR="${PROWLER_VERSION%%.*}"
@@ -89,15 +91,6 @@ jobs:
8991
;;
9092
esac
9193
92-
- name: Update Prowler version (release)
93-
id: update-prowler-version
94-
if: github.event_name == 'release'
95-
run: |
96-
PROWLER_VERSION="${{ github.event.release.tag_name }}"
97-
poetry version "${PROWLER_VERSION}"
98-
echo "PROWLER_VERSION=${PROWLER_VERSION}" >> "${GITHUB_ENV}"
99-
echo "PROWLER_VERSION=${PROWLER_VERSION}" >> "${GITHUB_OUTPUT}"
100-
10194
- name: Login to DockerHub
10295
uses: docker/login-action@v3
10396
with:

.github/workflows/pypi-release.yml

-21
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,13 @@ jobs:
4040
- name: Install dependencies
4141
run: |
4242
pipx install poetry
43-
pipx inject poetry poetry-bumpversion
4443
4544
- name: Setup Python
4645
uses: actions/setup-python@v5
4746
with:
4847
python-version: ${{ env.PYTHON_VERSION }}
4948
cache: ${{ env.CACHE }}
5049

51-
- name: Update Poetry and config version
52-
run: |
53-
poetry version ${{ env.RELEASE_TAG }}
54-
5550
- name: Import GPG key
5651
uses: crazy-max/ghaction-import-gpg@v6
5752
with:
@@ -60,22 +55,6 @@ jobs:
6055
git_user_signingkey: true
6156
git_commit_gpgsign: true
6257

63-
- name: Push updated version to the release tag
64-
run: |
65-
# Configure Git
66-
git config user.name "github-actions"
67-
git config user.email "${{ env.GIT_COMMITTER_EMAIL }}"
68-
69-
# Add the files with the version changed
70-
git add prowler/config/config.py pyproject.toml
71-
git commit -m "chore(release): ${{ env.RELEASE_TAG }}" --no-verify -S
72-
73-
# Replace the tag with the version updated
74-
git tag -fa ${{ env.RELEASE_TAG }} -m "chore(release): ${{ env.RELEASE_TAG }}" --sign
75-
76-
# Push the tag
77-
git push -f origin ${{ env.RELEASE_TAG }}
78-
7958
- name: Build Prowler package
8059
run: |
8160
poetry build

0 commit comments

Comments
 (0)