Skip to content

Commit 9dd3ff9

Browse files
authored
Merge branch 'main' into dependabot/uv/uv-build-gte-0.9.28-and-lt-0.11.0
2 parents 388ee4b + fd5b351 commit 9dd3ff9

8 files changed

Lines changed: 132 additions & 112 deletions

File tree

.github/workflows/cache-uv-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build-cache:
1414
runs-on: ubuntu-latest
1515
env:
16-
UV_VERSION: '0.9.28'
16+
UV_VERSION: '0.10.2'
1717
PYTHON_VERSION: '3.13'
1818

1919
steps:

.github/workflows/docker-build-and-scan.yaml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Docker Build and Trivy Scan
22

33
on:
4-
push:
5-
branches:
6-
- '**'
7-
84
workflow_call:
95
inputs:
106
DOCKER_PATH_CONTEXT:
@@ -13,46 +9,45 @@ on:
139
DOCKER_BUILD_DOCKERFILE:
1410
required: true
1511
type: string
16-
DOCKER_LOAD_BOOL:
17-
required: true
18-
type: boolean
1912
DOCKER_TAGS:
2013
required: true
2114
type: string
15+
DOCKER_LOAD_BOOL:
16+
required: false
17+
type: boolean
18+
default: false
19+
DOCKER_PUSH_BOOL:
20+
required: false
21+
type: boolean
22+
default: false
2223

2324
jobs:
2425
build-and-scan:
2526
runs-on: ubuntu-latest
26-
env:
27-
DOCKER_PATH_CONTEXT: .
28-
DOCKER_BUILD_DOCKERFILE: Dockerfile
29-
DOCKER_LOAD_BOOL: true
30-
DOCKER_TAGS: sample-python-app:${{ github.sha }}
3127
steps:
3228
- name: Checkout repository
33-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3430
- name: Set up QEMU
3531
uses: docker/setup-qemu-action@v3
3632
- name: Set up Docker Buildx
3733
uses: docker/setup-buildx-action@v3
3834
- name: Login to DockerHub
39-
if: github.event_name == 'workflow_call'
4035
uses: docker/login-action@v3
4136
with:
42-
username: ${{ secrets.DOCKERHUB_USERNAME }}
37+
username: ${{ vars.DOCKERHUB_USERNAME }}
4338
password: ${{ secrets.DOCKERHUB_TOKEN }}
4439
- name: Build (and maybe push) Docker image
4540
uses: docker/build-push-action@v6
4641
with:
47-
context: ${{ github.event_name == 'workflow_call' && inputs.DOCKER_PATH_CONTEXT || env.DOCKER_PATH_CONTEXT }}
48-
file: ${{ github.event_name == 'workflow_call' && inputs.DOCKER_BUILD_DOCKERFILE || env.DOCKER_BUILD_DOCKERFILE }}
49-
load: ${{ github.event_name != 'workflow_call' }}
50-
push: ${{ github.event_name == 'workflow_call' }}
51-
tags: ${{ github.event_name == 'workflow_call' && inputs.DOCKER_TAGS || env.DOCKER_TAGS }}
52-
- name: Run Trivy vulnerability scanner
42+
context: ${{ inputs.DOCKER_PATH_CONTEXT }}
43+
file: ${{ inputs.DOCKER_BUILD_DOCKERFILE}}
44+
load: ${{ inputs.DOCKER_LOAD_BOOL }}
45+
push: ${{ inputs.DOCKER_PUSH_BOOL }}
46+
tags: ${{ inputs.DOCKER_TAGS }}
47+
- name: Run Trivy vulnerability scanner (remote)
5348
uses: aquasecurity/trivy-action@0.33.1
5449
with:
55-
image-ref: ${{ inputs.DOCKER_TAGS || env.DOCKER_TAGS }}
50+
image-ref: docker.io/${{ inputs.DOCKER_TAGS }}
5651
format: 'table'
5752
exit-code: '1'
5853
ignore-unfixed: true

.github/workflows/pylint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
contents: read
1313
env:
14-
UV_VERSION: '0.9.28'
14+
UV_VERSION: '0.10.2'
1515
PYTHON_VERSION: '3.13'
1616

1717
steps:

.github/workflows/pytest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
contents: read
1313
env:
14-
UV_VERSION: '0.9.28'
14+
UV_VERSION: '0.10.2'
1515
PYTHON_VERSION: '3.13'
1616
steps:
1717
- name: Checkout repository

.github/workflows/release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
dist_artifacts_name: dist
2020
dist_artifacts_dir: dist
2121
lock_file_artifact: uv.lock
22-
UV_VERSION: '0.9.28'
22+
UV_VERSION: '0.10.2'
2323
PYTHON_VERSION: '3.13'
2424
GITHUB_ACTIONS_AUTHOR_NAME: github-actions
2525
GITHUB_ACTIONS_AUTHOR_EMAIL: actions@users.noreply.github.com
@@ -77,12 +77,13 @@ jobs:
7777
.venv
7878
key: uv-main-${{ env.UV_VERSION }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
7979

80-
docker-build-and-scan:
80+
Docker-Release:
81+
uses: ./.github/workflows/docker-build-and-scan.yaml
8182
needs: Semantic-Release
82-
uses: milsman2/python-app-template/.github/workflows/docker-build-and-scan.yaml@main
8383
secrets: inherit
8484
with:
8585
DOCKER_PATH_CONTEXT: .
8686
DOCKER_BUILD_DOCKERFILE: Dockerfile
87-
DOCKER_LOAD_BOOL: true
87+
DOCKER_LOAD_BOOL: false
8888
DOCKER_TAGS: milsman2/sample-python-app:${{ needs.Semantic-Release.outputs.tag }}
89+
DOCKER_PUSH_BOOL: true
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Scan Release Branch with Trivy
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
jobs:
8+
docker-build-and-scan:
9+
uses: ./.github/workflows/docker-build-and-scan.yaml
10+
secrets: inherit
11+
with:
12+
DOCKER_PATH_CONTEXT: .
13+
DOCKER_BUILD_DOCKERFILE: Dockerfile
14+
DOCKER_LOAD_BOOL: true
15+
DOCKER_TAGS: sample-python-app:${{ github.sha }}
16+
DOCKER_PUSH_BOOL: false

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies = [
2121
]
2222

2323
[project.optional-dependencies]
24-
build = ["uv >= 0.9.28"]
24+
build = ["uv >= 0.10.2"]
2525

2626
[build-system]
2727
requires = ["uv_build>=0.9.28,<0.11.0"]

0 commit comments

Comments
 (0)