8 Commits

Author SHA1 Message Date
29902b2e8e chore(release): 1.2.3 2021-04-14 20:43:46 +01:00
36e0863cc3 fix(release): add missing GITHUB_TOKEN env var 2021-04-14 20:43:18 +01:00
5471ff95a7 chore(release): 1.2.2 2021-04-14 20:39:57 +01:00
4c89c92f75 build(release): tweak goreleaser config 2021-04-14 20:38:46 +01:00
d19eed020c Merge pull request #3 from jimeh/github-actions
ci(github): switch from CircleCI to GitHub Actions
2021-04-14 20:34:57 +01:00
aef3e832f5 ci(github): switch from CircleCI to GitHub Actions 2021-04-14 20:32:50 +01:00
3bae8acc62 chore(release): 1.2.1 2021-04-14 20:13:01 +01:00
eaf738c49f fix(release): fix goreleaser setup 2021-04-14 20:12:23 +01:00
5 changed files with 71 additions and 85 deletions

View File

@@ -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
View 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
View File

@@ -1,3 +1,4 @@
bin/*
dist/*
releases/*
dist/

View File

@@ -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:"

View File

@@ -1 +1 @@
1.2.0
1.2.3