From 4bc6a68cae6ca77abe7b6147d166f5d7c5c4a4ac Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Wed, 15 Jan 2025 22:32:35 +0000 Subject: [PATCH] feat: migrate to Gitea --- .gitea/CODEOWNERS | 1 + .gitea/workflows/build_docker.yml | 18 ++++++++++++++++++ .gitea/workflows/ci.yml | 22 ++++++++++++++++++++++ .gitea/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 9 ++++----- 5 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 .gitea/CODEOWNERS create mode 100644 .gitea/workflows/build_docker.yml create mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/CODEOWNERS b/.gitea/CODEOWNERS new file mode 100644 index 0000000..e286c1e --- /dev/null +++ b/.gitea/CODEOWNERS @@ -0,0 +1 @@ +* @luke diff --git a/.gitea/workflows/build_docker.yml b/.gitea/workflows/build_docker.yml new file mode 100644 index 0000000..e7aa3cd --- /dev/null +++ b/.gitea/workflows/build_docker.yml @@ -0,0 +1,18 @@ +name: Build Docker +on: + release: + types: + - published + +jobs: + create_docker: + name: Create Docker Image + uses: https://git.tainton.uk/actions/gha-workflows/.gitea/workflows/build-push-docker.yml@main + with: + release: ${{ gitea.event.release.name }} + registry: ${{ vars.PACKAGES_REGISTRY_URL }} + actions_username: ${{ vars.ACTIONS_USERNAME }} + ghcr_username: ${{ vars.GHCR_USERNAME }} + secrets: + ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }} diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..bf3e053 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +jobs: + validate_pr_title: + uses: https://git.tainton.uk/actions/gha-workflows/.gitea/workflows/conventional-commit.yml@main + with: + commit_message: ${{ gitea.event.pull_request.title }} + + ci: + uses: https://git.tainton.uk/actions/gha-workflows/.gitea/workflows/ci-docker.yml@main + with: + python-version: 3.13 + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..a656f16 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release +on: + workflow_dispatch: + push: + branches: + - master + - main + +jobs: + test: + name: Test + uses: https://git.tainton.uk/actions/gha-workflows/.gitea/workflows/ci-docker.yml@main + with: + python-version: 3.13 + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + + create_release: + name: Create Release + needs: test + uses: https://git.tainton.uk/actions/gha-workflows/.gitea/workflows/create-release.yml@main + secrets: + ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }} + + print_release: + name: Print Release + runs-on: ubuntu-latest + needs: create_release + steps: + - run: echo "Created release ${{ needs.create_release.outputs.release_name }}." diff --git a/Dockerfile b/Dockerfile index ff74928..c74ef6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,12 @@ -FROM alpine:3.20 AS build +FROM alpine:3.21 AS build LABEL maintainer="Luke Tainton " -LABEL org.opencontainers.image.source="https://github.com/luketainton/docker-dnsmasq" FROM build AS webproc ENV WEBPROCVERSION 0.4.0 ENV WEBPROCURL https://github.com/jpillora/webproc/releases/download/v$WEBPROCVERSION/webproc_"$WEBPROCVERSION"_linux_amd64.gz -RUN apk add --no-cache curl -RUN curl -sL "$WEBPROCURL" | gzip -d - > /usr/local/bin/webproc -RUN chmod +x /usr/local/bin/webproc +RUN apk add --no-cache curl && \ + curl -sL "$WEBPROCURL" | gzip -d - > /usr/local/bin/webproc && \ + chmod +x /usr/local/bin/webproc FROM build AS dnsmasq RUN apk --no-cache add dnsmasq=2.90-r3