Skip to content

Commit 11465ff

Browse files
authored
Merge pull request #28 from paullockaby/migrating-with-actions
feat: updating name and adding workflows
2 parents 4a09548 + 868615e commit 11465ff

14 files changed

Lines changed: 259 additions & 38 deletions

.cz.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tool.commitizen]
2+
name = "cz_conventional_commits"
3+
tag_format = "v$version"
4+
version_scheme = "semver"
5+
version_provider = "scm"
6+
update_changelog_on_bump = true

.github/workflows/build.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/expire-packages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
uses: actions/delete-package-versions@v5
1414
with:
1515
package-type: "container"
16-
package-name: "docker-debug"
16+
package-name: "container-debug"
1717
min-versions-to-keep: 10
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Container
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
packages: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Configure Docker for multi-arch builds
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker buildx for multi-arch builds
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to the GitHub Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.repository_owner }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build, tag, and push docker image to the GitHub Container Registry
33+
run: make push
34+
35+
- name: Update release
36+
uses: softprops/action-gh-release@v2
37+
with:
38+
files: |
39+
dist/*
40+
CHANGELOG.md
41+
tag_name: "${{ github.ref_name }}"
42+
43+
- run: |
44+
echo "Finished building and pushing containers for version ${{ github.ref_name }}."
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Create Release
2+
3+
on:
4+
# only trigger this workflow manually
5+
workflow_dispatch:
6+
inputs:
7+
increment:
8+
description: "Set a field to increment."
9+
required: false
10+
default: ""
11+
type: choice
12+
options:
13+
- ""
14+
- MAJOR
15+
- MINOR
16+
- PATCH
17+
prerelease:
18+
description: "Set as a prerelease version."
19+
required: false
20+
default: ""
21+
type: choice
22+
options:
23+
- ""
24+
- alpha
25+
- beta
26+
- rc
27+
28+
jobs:
29+
tests:
30+
uses: ./.github/workflows/tests.yaml
31+
secrets: inherit
32+
33+
security:
34+
uses: ./.github/workflows/security.yaml
35+
secrets: inherit
36+
37+
bump_version:
38+
runs-on: ubuntu-latest
39+
40+
# only run if the other jobs succeed
41+
needs:
42+
- tests
43+
- security
44+
45+
permissions:
46+
contents: write
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
ssh-key: "${{ secrets.DEPLOY_KEY }}"
53+
54+
- id: cz
55+
name: Create changelog and bump version
56+
uses: commitizen-tools/commitizen-action@0.24.0
57+
with:
58+
changelog: true
59+
changelog_increment_filename: "changes.md"
60+
git_redirect_stderr: true
61+
increment: ${{ inputs.increment }}
62+
prerelease: ${{ inputs.prerelease }}
63+
push: false
64+
65+
- name: Push changelog updates
66+
run: |
67+
git push origin main --tags
68+
69+
- name: Create release
70+
uses: softprops/action-gh-release@v2
71+
with:
72+
body_path: "changes.md"
73+
tag_name: "v${{ steps.cz.outputs.version }}"
74+
75+
- run: |
76+
echo "Bumped to version v${{ steps.cz.outputs.version }}"

.github/workflows/security.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Security Scanning
2+
3+
on:
4+
workflow_call:
5+
schedule:
6+
- cron: "0 2 * * 1"
7+
8+
jobs:
9+
trivy:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup trivy
19+
uses: aquasecurity/setup-trivy@v0.2.2
20+
with:
21+
cache: true
22+
version: latest
23+
24+
- name: Run trivy configuration checks
25+
run: |
26+
trivy config . --config=.trivy.yaml --ignorefile=.trivyignore
27+
28+
- name: Run trivy filesystem checks
29+
run: |
30+
trivy filesystem . --config=.trivy.yaml --ignorefile=.trivyignore --no-progress

.github/workflows/tests.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Linters and Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
pre-commit:
8+
if: github.event_name == 'pull_request'
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.13.x"
21+
cache: "pip"
22+
23+
- name: Run linter
24+
uses: pre-commit/action@v3.0.1
25+
env:
26+
SKIP: no-commit-to-branch

.pre-commit-config.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
exclude: '^$'
2+
fail_fast: false
3+
default_install_hook_types: [pre-commit, pre-push, commit-msg]
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v5.0.0
8+
hooks:
9+
- id: check-added-large-files
10+
stages: [pre-commit]
11+
- id: check-json
12+
stages: [pre-commit]
13+
- id: check-toml
14+
stages: [pre-commit]
15+
- id: check-yaml
16+
args: [--allow-multiple-documents]
17+
stages: [pre-commit]
18+
- id: check-xml
19+
stages: [pre-commit]
20+
- id: check-shebang-scripts-are-executable
21+
stages: [pre-commit]
22+
- id: check-executables-have-shebangs
23+
stages: [pre-commit]
24+
- id: check-merge-conflict
25+
stages: [pre-commit]
26+
- id: check-case-conflict
27+
stages: [pre-commit]
28+
- id: check-symlinks
29+
stages: [pre-commit]
30+
- id: destroyed-symlinks
31+
stages: [pre-commit]
32+
- id: detect-private-key
33+
stages: [pre-commit]
34+
- id: mixed-line-ending
35+
exclude: "(^.idea/|.vscode/|CHANGELOG.md)"
36+
stages: [pre-commit]
37+
- id: trailing-whitespace
38+
exclude: "(^.idea/|.vscode/|CHANGELOG.md)"
39+
stages: [pre-commit]
40+
- id: end-of-file-fixer
41+
exclude: "(^.idea/|.vscode/|CHANGELOG.md)"
42+
stages: [pre-commit]
43+
- id: no-commit-to-branch
44+
args: [--branch, main]
45+
stages: [pre-commit]
46+
47+
- repo: https://github.com/commitizen-tools/commitizen
48+
rev: v4.1.0
49+
hooks:
50+
- id: commitizen
51+
- id: commitizen-branch
52+
stages: [pre-push]

.trivy.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
exit-code: 1
2+
3+
severity:
4+
- HIGH
5+
- CRITICAL
6+
7+
scan:
8+
skip-dirs: []

.trivyignore

Whitespace-only changes.

0 commit comments

Comments
 (0)