Skip to content

Commit e22ba3f

Browse files
committed
improve workflows
1 parent c00673e commit e22ba3f

File tree

4 files changed

+159
-0
lines changed

4 files changed

+159
-0
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
13+
- package-ecosystem: "pip"
14+
directory: "/" # Location of package manifests
15+
schedule:
16+
interval: "weekly"
17+
ignore:
18+
- dependency-name: "django"
19+
update-types: [ "version-update:semver-major", "version-update:semver-minor" ] # only allow auto update on django bug and security fixes
20+
open-pull-requests-limit: 20

.github/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
changelog:
2+
categories:
3+
- title: 💥 Breaking changes
4+
labels:
5+
- '💥 Breaking changes'
6+
- title: ✨ New features
7+
labels:
8+
- '✨ Feature'
9+
- title: 💫 Improvements
10+
labels:
11+
- '💫 Improvements'
12+
- '💄 UI/UX'
13+
- title: 🐛 Bug fixes
14+
labels:
15+
- '🐛 bug'
16+
- '🚑 Hotfix'
17+
- title: ⚡ Performances
18+
labels:
19+
- '⚡ Performances'
20+
- title: 🔒 Security
21+
labels:
22+
- '🔒 Security'
23+
- title: 📝 Documentation
24+
labels:
25+
- '📝 Documentation'
26+
- 'scope: docs'
27+
- '🌐 Translations'
28+
- title: ♻️ Refactoring
29+
labels:
30+
- '♻️ Refactoring'
31+
- title: ✅ Tests
32+
labels:
33+
- '✅ Tests'
34+
- title: 👷 CI
35+
labels:
36+
- '👷 CI'
37+
- github_actions
38+
- 'scope: deployment'
39+
- title: 🏗️ Maintenance
40+
labels:
41+
- dependencies
42+
- '🏗️ Maintenance'
43+
- title: Other Changes
44+
labels:
45+
- "*"

.github/workflows/dependencies.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Check deps
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- pyproject.toml
7+
- requirements.txt
8+
- requirements-dev.txt
9+
- .github/workflows/dependencies.yml
10+
11+
env:
12+
DEBIAN_FRONTEND: noninteractive
13+
14+
jobs:
15+
quality:
16+
name: Checking dependency graph
17+
runs-on: ubuntu:latest
18+
strategy:
19+
matrix:
20+
os: ['ubuntu-latest']
21+
python-version: ['3.10']
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: astral-sh/setup-uv@v5
27+
with:
28+
version: "latest"
29+
python-version: "3.12"
30+
31+
- name: Check dependency graph
32+
run: |
33+
uv pip compile pyproject.toml -o requirements.txt
34+
uv pip compile pyproject.toml --extra dev -c requirements.txt -o requirements-dev.txt
35+
36+
- name: Verify dependency graph is ok
37+
uses: tj-actions/verify-changed-files@v20
38+
id: verify-changed-files
39+
with:
40+
files: |
41+
requirements.txt
42+
requirements-dev.txt
43+
44+
- name: Validating graph
45+
if: steps.verify-changed-files.outputs.files_changed == 'true'
46+
run: |
47+
echo "Dependency file(s) changed: ${{ steps.verify-changed-files.outputs.changed_files }}"
48+
git diff
49+
core.setFailed('Please fix your dependency with uv pip compile commands')

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
on:
3+
workflow_run:
4+
workflows: ["Run Tests"]
5+
branches: [main]
6+
types:
7+
- completed
8+
9+
jobs:
10+
release:
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main' }}
12+
runs-on: ubuntu-latest
13+
permissions:
14+
packages: write # required to publish docker image
15+
steps:
16+
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Login to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.repository_owner }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Set up Docker Buildx
28+
id: buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Extract metadata
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: |
36+
ghcr.io/makinacorpus/osm-paths
37+
38+
- name: Build and push image
39+
uses: docker/build-push-action@v6
40+
with:
41+
push: true
42+
provenance: mode=max
43+
sbom: true
44+
builder: ${{ steps.buildx.outputs.name }}
45+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)