Skip to content

Commit a5c39db

Browse files
committed
workflow files
1 parent ac99b4a commit a5c39db

File tree

6 files changed

+144
-0
lines changed

6 files changed

+144
-0
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'main'
8+
pull_request:
9+
branches:
10+
- 'master'
11+
- 'main'
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v3
23+
with:
24+
go-version: 1.18
25+
26+
- name: Build
27+
run: go build -v ./...

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
-
21+
name: Fetch all tags
22+
run: git fetch --force --tags
23+
-
24+
name: Set up Go
25+
uses: actions/setup-go@v3
26+
with:
27+
go-version: 1.18
28+
-
29+
name: Run GoReleaser
30+
uses: goreleaser/goreleaser-action@v4
31+
with:
32+
distribution: goreleaser
33+
version: latest
34+
args: release --rm-dist
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
TWITTER_CONSUMER_KEY: ${{ secrets.SOFTWARE_RELEASE_TWITTER_CONSUMER_KEY }}
38+
TWITTER_CONSUMER_SECRET: ${{ secrets.SOFTWARE_RELEASE_TWITTER_CONSUMER_SECRET }}
39+
TWITTER_ACCESS_TOKEN: ${{ secrets.SOFTWARE_RELEASE_TWITTER_ACCESS_TOKEN }}
40+
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.SOFTWARE_RELEASE_TWITTER_ACCESS_TOKEN_SECRET }}

.github/workflows/unit_test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'main'
8+
pull_request:
9+
branches:
10+
- 'master'
11+
- 'main'
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v3
23+
with:
24+
go-version: 1.18
25+
26+
- name: Run Unit Tests
27+
run: go test -v ./...

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
/.idea
3+
test/
4+
sources.yaml

.goreleaser.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
goos:
8+
- linux
9+
- darwin
10+
ldflags:
11+
- -s -w -X main.version={{.Tag}} -X main.goversion=1.18
12+
main: ./cmd/switch
13+
archives:
14+
- replacements:
15+
darwin: Darwin
16+
linux: Linux
17+
windows: Windows
18+
386: i386
19+
amd64: x86_64
20+
format_overrides:
21+
- goos: windows
22+
format: zip
23+
checksum:
24+
name_template: "CHECKSUMS_SHA256_{{ toupper .ProjectName }}_{{ .Version }}.txt"
25+
snapshot:
26+
name_template: "{{ incpatch .Version }}-next"
27+
changelog:
28+
sort: asc
29+
filters:
30+
exclude:
31+
- '^docs:'
32+
- '^test:'
33+
announce:
34+
twitter:
35+
enabled: false
36+
message_template: 'Hey "{{ .ProjectName }}" {{ .Tag }} is out! You can check it out at {{ .ReleaseURL }}!!'

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
### Preprocess JSON to `name` and `value` keys for Morpheus
44

5+
[![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/spoonboy-io/switch?style=flat-square)](https://go.dev/)
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/spoonboy-io/switch?style=flat-square)](https://goreportcard.com/report/github.com/spoonboy-io/switch)
7+
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/spoonboy-io/switch/build.yml?branch=master&style=flat-square)](https://github.com/spoonboy-io/switch/actions/workflows/build.yml)
8+
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/spoonboy-io/switch/unit_test.yml?branch=master&label=tests&style=flat-square)](https://github.com/spoonboy-io/switch/actions/workflows/unit_test.yml)
9+
10+
[ ![ GitHub Release Date ](https://img.shields.io/github/release-date/spoonboy-io/switch?style=flat-square) ](https://github.com/spoonboy-io/switch/releases)
11+
[![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/spoonboy-io/switch/latest?style=flat-square)](https://github.com/spoonboy-io/switch/commits)
12+
[![GitHub](https://img.shields.io/github/license/spoonboy-io/switch?label=license&style=flat-square)](LICENSE)
13+
14+
515
## About
616

717
Switch performs preprocessing on JSON data. Designed to simplify Morpheus option list creation and management,

0 commit comments

Comments
 (0)