From 49acca1c798ce64353f923d9609274506bfd7241 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 10 Dec 2025 22:16:37 -0800 Subject: [PATCH 1/2] Switch to gitea actions --- .drone.yml | 100 -------------------------------- .gitea/workflows/build.yml | 113 +++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 100 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/build.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index c7e42b7..0000000 --- a/.drone.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -kind: pipeline -name: test - -steps: - - name: test - image: golang:1.25 - environment: - VERSION: ${DRONE_TAG:-${DRONE_COMMIT}} - commands: - - make test - - - name: check - image: iamthefij/drone-pre-commit:personal - ---- -kind: pipeline -name: publish - -depends_on: - - test - -trigger: - event: - - push - - tag - refs: - - refs/heads/master - - refs/tags/v* - -steps: - - name: build all binaries - image: golang:1.25 - environment: - VERSION: ${DRONE_TAG:-${DRONE_COMMIT}} - commands: - - make all - - - name: compress binaries for release - image: ubuntu - commands: - - find ./dist -type f -executable -execdir tar -czvf {}.tar.gz {} \; - when: - event: tag - - - name: upload gitea release - image: plugins/gitea-release - settings: - title: ${DRONE_TAG} - files: dist/*.tar.gz - checksum: - - md5 - - sha1 - - sha256 - - sha512 - base_url: - from_secret: gitea_base_url - api_key: - from_secret: gitea_token - when: - event: tag - - - name: Build and publish docker images - image: thegeeklab/drone-docker-buildx - settings: - repo: iamthefij/minitor-go - auto_tag: true - platforms: - - linux/amd64 - - linux/arm64 - - linux/arm - username: - from_secret: docker_username - password: - from_secret: docker_password - ---- -kind: pipeline -name: notify - -depends_on: - - test - - publish - -trigger: - status: - - failure - -steps: - - - name: notify - image: drillster/drone-email - settings: - host: - from_secret: SMTP_HOST # pragma: whitelist secret - username: - from_secret: SMTP_USER # pragma: whitelist secret - password: - from_secret: SMTP_PASS # pragma: whitelist secret - from: drone@iamthefij.com diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..ffb74e5 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,113 @@ +name: ci +on: + push: + branches: + - main + - master + tags: + - "v*" + pull_request: + branches: + - main + - master + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Run tests + run: make test + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Set up Python + uses: actions/setup-python@v5 + + - name: Run pre-commit + uses: https://git.iamthefij.com/iamthefij/pre-commit-action@v3.0.2 + + release: + runs-on: ubuntu-latest + needs: test + if: "${{ github.event_name != 'pull_request' }}" + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Build binaries + env: + VERSION: "${{ vars.REF_NAME }}" + run: make all + + # Package binaries and create release if this is a tagged build + - name: Compress binaries + if: "${{ github.event_name == 'tag' }}" + run: find ./dist -type f -executable -execdir tar -czvf {}.tar.gz {} \; + + - name: Upload release + uses: https://gitea.com/actions/gitea-release-action@v1 + if: "${{ github.event_name == 'tag' }}" + with: + files: |- + dist/*.tar.gz + md5sum: true + sha256sum: true + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + ${{ github.REPOSITORY }} + # generate Docker tags based on the following events/attributes + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + # Use path context so we can access pre-compiled binaries + context: . + push: ${{ github.event_name != 'pull_request' }} + platforms: | + linux/amd64 + linux/arm64 + linux/arm + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 845604c54c4a3455314c7555bf2682622e02d83e Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 11 Dec 2025 11:03:39 -0800 Subject: [PATCH 2/2] Use temporary hadolint hook location --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc2aece..26a706e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,6 +15,6 @@ repos: hooks: - id: golangci-lint - repo: https://github.com/hadolint/hadolint - rev: v2.12.1-beta + rev: refs/pull/1152/head hooks: - - id: hadolint + - id: hadolint-github