From 7aa23d5ac38190943d43b164f641dc5d3bc990bf Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 15:43:39 -0500 Subject: [PATCH 1/9] :sparkles: Adding local main function --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 3391d10..1354519 100644 --- a/main.py +++ b/main.py @@ -8,4 +8,7 @@ @app.route('/') def index(): """Return a friendly HTTP greeting.""" - return "Hello, World!" \ No newline at end of file + return "Hello, World!" + +if __name__ == '__main__': + app.run(debug=True, host="0.0.0.0", port=8080) \ No newline at end of file From 53a8ac7ccee0a5f0cccae2ae0626237ddd4f310c Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 15:47:59 -0500 Subject: [PATCH 2/9] :hammer: Added steps release workflow --- .github/workflows/release.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96a80f4..702f6e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,6 @@ jobs: REPO_NAME: ${{ env.REPO_NAME }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - module_name: 'poc_module' - name: Tag generated run: echo "RELEASE_TAG=${{ steps.semantic_release.outputs.release_version }}" >> $GITHUB_ENV @@ -47,10 +46,21 @@ jobs: ## IMPORTANT: this permission is mandatory for Trusted Publishing id-token: write steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install build and twine + run: python -m pip install --upgrade pip build twine bump2version wheel + - name: Publish run: | python -m build twine upload dist/* --repository-url https://upload.pypi.org/legacy/ --verbose env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{secrets.PYPI_TOKEN}} + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} From 2bb777af43d6727401c7ecdf39482ffff3cd69fd Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 15:49:36 -0500 Subject: [PATCH 3/9] :hammer: modifed branches trigger --- .github/workflows/deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 945eea5..d20a608 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,8 @@ name: Deploy Python Application on: push: branches: - - main + - master + - dev jobs: build-and-deploy: From 2701fcd693d46ba7da45a3e08f6bf6d6b748e886 Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 15:51:35 -0500 Subject: [PATCH 4/9] :bug: Fixed dependency --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 84f360a..1d1c029 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ Flask==2.0.3 google-cloud-functions==1.0.0 -request==2.26.0 \ No newline at end of file +requests==2.26.0 \ No newline at end of file From 42dab4e5128cf35dbabbeb8bc6fffc86f69041b7 Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 16:00:06 -0500 Subject: [PATCH 5/9] :hammer: modified trigger --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/release.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d20a608..8fb1c2f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 702f6e6..7fc78f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,9 @@ name: Release Process on: pull_request: branches: [master] + types: [closed] + push: + branches: [master] workflow_dispatch: jobs: From c47077f4ae8eaf0d9b2fd5d6091703be7bab8e75 Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 16:04:00 -0500 Subject: [PATCH 6/9] :bug: Fixed dependencies --- main.py | 1 + requirements.txt | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 1354519..9df98bf 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ from flask import Flask, request, jsonify from google.cloud import storage +import os app = Flask(__name__) diff --git a/requirements.txt b/requirements.txt index 1d1c029..4e827d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ -Flask==2.0.3 +Flask==3.0.3 google-cloud-functions==1.0.0 -requests==2.26.0 \ No newline at end of file +requests==2.26.0 +Werkzeug==3.03 +gunicorn==23.0.0 \ No newline at end of file From d63780a348c52d2888120e02a3b4b68fbe9dd75f Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 16:05:00 -0500 Subject: [PATCH 7/9] :bug: Fixed dependencies --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4e827d9..1406177 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Flask==3.0.3 google-cloud-functions==1.0.0 requests==2.26.0 -Werkzeug==3.03 +Werkzeug==3.0.3 gunicorn==23.0.0 \ No newline at end of file From 2d634206c9e6349ac2ddfbbcb853889f60965718 Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 16:11:00 -0500 Subject: [PATCH 8/9] :hammer: Refactor deploy workflow --- .github/workflows/deploy.yml | 7 ++----- main.py | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8fb1c2f..c29a12a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,13 +20,10 @@ jobs: python-version: '3.x' - name: Install dependencies - run: | - pip install -r requirements.txt - pip install -r requirement-test.txt + run: pip install -r requirements.txt - name: Run tests - run: | - pytest main_test.py + run: pytest # - name: Deploy to Cloud Functions # run: | diff --git a/main.py b/main.py index 9df98bf..041ff7d 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,6 @@ __version__ = "0.1.0" from flask import Flask, request, jsonify -from google.cloud import storage import os app = Flask(__name__) From 6abf81b20ceb42d094ea62dbd6444ed8ab3926de Mon Sep 17 00:00:00 2001 From: mitzyvalenciaordonez Date: Tue, 10 Jun 2025 16:13:09 -0500 Subject: [PATCH 9/9] :hammer: refactor deploy workflow --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c29a12a..a011f2c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,9 @@ jobs: python-version: '3.x' - name: Install dependencies - run: pip install -r requirements.txt + run: | + pip install -r requirements.txt + pip install -r requirement-test.txt - name: Run tests run: pytest