diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index c8a6841..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended", - ":semanticCommits", - ":semanticCommitTypeAll(chore)", - ":semanticCommitScope(deps)" - ], - "labels": [ - "type: dependencies" - ], - "assigneesFromCodeOwners": true, - "configMigration": true, - "commitMessageAction": "update", - "commitMessagePrefix": "chore(deps):" -} \ No newline at end of file diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..24f8396 --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,6 @@ +{ + $schema: 'https://docs.renovatebot.com/renovate-schema.json', + extends: [ + 'github>HyperaDev/actions', + ], +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f63c7d6..efec3c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,64 +1,17 @@ -# GitHub Actions workflow to build, test and publish the project. +# GitHub Actions workflow to build and test a Go project. name: "Go" on: push: branches: [ "main" ] pull_request: branches: [ "main" ] - -env: - GO_VERSION: "1.21.3" + merge_group: jobs: - govulncheck: - name: "Vulnerability Check" - runs-on: "ubuntu-latest" - permissions: - contents: read - steps: - - name: "Checkout repository" - uses: actions/checkout@v4 - - - name: "Set up Go ${{ env.GO_VERSION }}" - uses: actions/setup-go@v4 - with: - go-version: "${{ env.GO_VERSION }}" - cache: true - - - name: "Install" - run: go install golang.org/x/vuln/cmd/govulncheck@latest - - - name: "Run" - run: govulncheck ./... - build: name: "Build" - runs-on: "ubuntu-latest" - permissions: - contents: read - steps: - - name: "Checkout repository" - uses: actions/checkout@v4 - - - name: "Set up Go ${{ env.GO_VERSION }}" - uses: actions/setup-go@v4 - with: - go-version: "${{ env.GO_VERSION }}" - cache: true - - - name: "Download dependencies" - run: go mod download - - - name: "Verify dependencies" - run: go mod verify - - - name: "Build" - run: go build -v ./... - - - name: "Test" - run: go test -v ./... - - - name: "Test (race)" - run: go test -race -v ./... - -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + uses: HyperaDev/actions/.github/workflows/go-build.yml@main + with: + go_version: "stable" + codecov_enabled: true + vulncheck_enabled: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 261acbd..adaa0ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,67 +1,17 @@ -# GitHub Actions workflow to create a new release +# GitHub Actions workflow to release a Go project using GoReleaser. +# Releases are published from tags matching "v*.*.*". name: "Release" on: push: tags: [ "v*.*.*" ] -concurrency: - group: release - cancel-in-progress: true - -env: - GO_VERSION: "1.21.3" - jobs: release: name: "Release" - runs-on: "ubuntu-latest" - permissions: - contents: read - packages: write - env: - DOCKER_CLI_EXPERIMENTAL: enabled - steps: - - name: "Checkout repository" - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: "Set up Go ${{ env.GO_VERSION }}" - uses: actions/setup-go@v4 - with: - go-version: "${{ env.GO_VERSION }}" - cache: true - check-latest: true - - - name: "Run go mod tidy" - run: go mod tidy - - - name: "Set up QEMU" - uses: docker/setup-qemu-action@v3 - - - name: "Set up Docker Buildx" - uses: docker/setup-buildx-action@v3 - - - name: "Login to DockerHub" - uses: docker/login-action@v3 - with: - username: "${{ secrets.DOCKERHUB_USERNAME }}" - password: "${{ secrets.DOCKERHUB_TOKEN }}" - - - name: "Login to GitHub Container Registry" - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: "${{ github.repository_owner }}" - password: "${{ secrets.GITHUB_TOKEN }}" - - - name: "Release" - uses: goreleaser/goreleaser-action@v5 - with: - version: "latest" - distribution: "goreleaser" - args: "release --clean" - env: - GITHUB_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}" - -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json + uses: HyperaDev/actions/.github/workflows/go-release.yml@main + with: + docker_enabled: true + secrets: + DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}" + DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" + GITHUB_RELEASE_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}"