Skip to content

Commit

Permalink
Merge pull request #52 from omissis/main-fork
Browse files Browse the repository at this point in the history
Review and merge all upstream's pull requests
  • Loading branch information
omissis committed Apr 8, 2023
2 parents 4badc2d + 2e6ca5a commit dc1020c
Show file tree
Hide file tree
Showing 44 changed files with 2,024 additions and 532 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/build-and-test.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: development

on:
push:
branches:
- main
- introduce-gh-actions
pull_request:

permissions:
contents: read
pull-requests: read

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
qa:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: "^1.19.4"
- name: Lint Go files
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
args: -v --color=always --config=.rules/.golangci.yml ./...
- name: Run tests
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Build binaries
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: "1.13.1"
args: release --debug --snapshot --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: "1.19.4"
65 changes: 65 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: tag

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]+"

permissions:
contents: write

concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: "^1.19.4"
- name: Lint Go files
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
args: -v --color=always --config=.rules/.golangci.yml ./...
- name: Run tests
run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./...
- name: Run GoReleaser for pre-release
if: ${{ contains(github.ref_name, '-') }}
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: "1.13.1"
args: release --debug --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GO_VERSION: "1.19.4"
- name: Log in to Docker Hub
if: ${{ !contains(github.ref_name, '-') }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Run GoReleaser for release
if: ${{ !contains(github.ref_name, '-') }}
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: "1.13.1"
args: release --debug --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GO_VERSION: "1.19.4"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.env
.envrc
.idea
.tool-versions
bin
coverage.out
58 changes: 58 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
project_name: go-jsonschema
before:
hooks:
- go mod tidy
builds:
- main: cmd/gojsonschema/main.go
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
ldflags:
- -s -w -X main.version={{.Version}} -X main.gitCommit={{.Commit}} -X main.buildTime={{.Date}} -X main.goVersion={{.Env.GO_VERSION}} -X main.osArch={{.Arch}}
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
release:
github:
owner: omissis
name: go-jsonschema
name_template: "{{ .Tag }}"
prerelease: auto
brews:
- name: go-jsonschema
tap:
owner: omissis
name: homebrew-go-jsonschema
skip_upload: auto
folder: Formula
homepage: "https://gihub.com/omissis/go-jsonschema"
description: "go-jsonschema binary"
test: |
system "#{bin}/go-jsonschema"
install: |
bin.install 'go-jsonschema'
dockers:
- skip_push: auto
image_templates:
- "omissis/go-jsonschema:latest"
- "omissis/go-jsonschema:v{{ .Major }}"
- "omissis/go-jsonschema:v{{ .Major }}.{{ .Minor }}"
- "omissis/go-jsonschema:{{ .Tag }}"
Loading

0 comments on commit dc1020c

Please sign in to comment.