Skip to content

Commit

Permalink
Add CircleCI (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelicianoTech authored Oct 17, 2023
1 parent da54b53 commit 53ac65e
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 9 deletions.
63 changes: 63 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
variables:
grv: &goreleaser-version "1.21.1"
gv: &go-version "1.21.3"

version: 2.1

orbs:
gor: hubci/goreleaser@2.4

workflows:
main-wf:
jobs:
- test
- gor/release:
name: goreleaser-snapshot
version: *goreleaser-version
go-version: *go-version
dry-run: true
post-steps:
- persist_to_workspace:
root: "."
paths:
- "dist"
release-wf:
jobs:
- test:
filters: &semverFilters
branches:
ignore: /.*/
tags:
# SemVer regex
only: /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
- gor/release:
name: goreleaser-publish
version: *goreleaser-version
go-version: *go-version
filters: *semverFilters
post-steps:
- persist_to_workspace:
root: "."
paths:
- "dist"
context: goreleaser-ctx

jobs:
test:
docker:
- image: cimg/go:1.21
steps:
- checkout
- restore_cache:
keys:
- go-mod-v1
- run:
name: "Download Dependancies"
command: go mod download
- run:
name: "Run Tests"
command: go test ./...
- save_cache:
key: go-mod-v1
paths:
- "/go/pkg/mod"
39 changes: 39 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
project_name: ippi

builds:
- dir: ippi
goos:
- linux
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=0

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}
files:
- LICENSE
- README.md

nfpms:
- file_name_template: "{{ .ProjectName }}-v{{ .Version }}-{{ .Arch }}"
vendor: "Cloud Unpacked"
homepage: "https://www.CloudUnpacked.com"
maintainer: "Ricardo N Feliciano <Ricardo@Feliciano.Tech>"
description: "A simple public IP address API"
license: MIT
formats:
- deb
bindir: /usr/bin

checksum:
name_template: "{{ .ProjectName }}-v{{ .Version }}-checksums.txt"

announce:
skip: "{{ gt .Patch 0 }}"
mastodon:
enabled: true
server: "https://nanobyte.cafe"
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion api/get_ip.go → ippi/api/get_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"net/http"
"strings"

"github.com/cloud-unpacked/ippi/models"
"github.com/cloud-unpacked/ippi/ippi/models"
"github.com/julienschmidt/httprouter"
)

Expand Down
2 changes: 1 addition & 1 deletion main.go → ippi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"net/http"
"os"

"github.com/cloud-unpacked/ippi/api"
"github.com/cloud-unpacked/ippi/ippi/api"
"github.com/julienschmidt/httprouter"
"github.com/rs/cors"
)
Expand Down
File renamed without changes.

0 comments on commit 53ac65e

Please sign in to comment.