mirror of
https://github.com/jimeh/casecmp.git
synced 2026-02-19 10:26:40 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
29902b2e8e
|
|||
|
36e0863cc3
|
|||
|
5471ff95a7
|
|||
|
4c89c92f75
|
|||
| d19eed020c | |||
|
aef3e832f5
|
|||
|
3bae8acc62
|
|||
|
eaf738c49f
|
@@ -1,65 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/golang:1.16
|
||||
working_directory: /go/src/github.com/jimeh/casecmp
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: go mod download
|
||||
- run:
|
||||
name: Build binary
|
||||
command: make
|
||||
- run:
|
||||
name: Start service
|
||||
command: ./bin/casecmp --port=8080
|
||||
background: true
|
||||
- run:
|
||||
name: Validate service is working
|
||||
command: |
|
||||
curl --retry 10 --retry-delay 1 --retry-connrefused \
|
||||
http://localhost:8080/
|
||||
release:
|
||||
docker:
|
||||
- image: circleci/golang:1.16
|
||||
working_directory: /go/src/github.com/jimeh/casecmp
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Install tools
|
||||
command: |
|
||||
go get github.com/goreleaser/goreleaser
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: go mod download
|
||||
- run:
|
||||
name: Run goreleaser
|
||||
command: goreleaser
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- build:
|
||||
filters:
|
||||
branches:
|
||||
only: /.*/
|
||||
tags:
|
||||
ignore: /^v[0-9]+(\.[0-9]+)*/
|
||||
build-and-release:
|
||||
jobs:
|
||||
- build:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v[0-9]+(\.[0-9]+)*/
|
||||
- release:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
only: /^v[0-9]+(\.[0-9]+)*/
|
||||
40
.github/workflows/ci.yml
vendored
Normal file
40
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: CI
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- name: Install dependencies
|
||||
run: go mod download
|
||||
- name: Build binary
|
||||
run: make
|
||||
- name: Run and make request
|
||||
run: |
|
||||
./bin/casecmp --port=8080 &
|
||||
curl --silent --retry 10 --retry-delay 1 --retry-connrefused \
|
||||
http://localhost:8080/
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
bin/*
|
||||
dist/*
|
||||
releases/*
|
||||
dist/
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
project_name: casecmp
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
builds:
|
||||
- main: main.go
|
||||
binary: casecmp
|
||||
flags: -a
|
||||
env:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- "-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }}"
|
||||
goos:
|
||||
- darwin
|
||||
- freebsd
|
||||
@@ -14,21 +18,27 @@ builds:
|
||||
- amd64
|
||||
- 386
|
||||
- arm
|
||||
- arm64
|
||||
goarm:
|
||||
- 6
|
||||
- 7
|
||||
archive:
|
||||
name_template: '{{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm
|
||||
}}v{{ .Arm }}{{ end }}'
|
||||
format: tar.gz
|
||||
wrap_in_directory: true
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
before:
|
||||
hooks:
|
||||
- make clean
|
||||
git:
|
||||
short_hash: true
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
name_template: |-
|
||||
{{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}
|
||||
wrap_in_directory: true
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
snapshot:
|
||||
name_template: snapshot-{{.Commit}}
|
||||
name_template: "{{ .Tag }}-next"
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
|
||||
Reference in New Issue
Block a user