Skip to content

Commit a475781

Browse files
committed
actions
1 parent 8d8b57f commit a475781

File tree

6 files changed

+175
-0
lines changed

6 files changed

+175
-0
lines changed

.github/workflows/go.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This workflow will build a golang project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3+
4+
name: Go
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.23'
23+
24+
- name: Build
25+
run: go build -v ./...

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: goreleaser
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: Set up Go
22+
uses: actions/setup-go@v4
23+
with:
24+
go-version: '1.21'
25+
-
26+
name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v5
28+
with:
29+
distribution: goreleaser
30+
version: latest
31+
args: release --clean
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
before:
4+
hooks:
5+
# You may remove this if you don't use go modules.
6+
- go mod tidy
7+
builds:
8+
- id: macos #build:macos
9+
goos: [darwin]
10+
goarch: [amd64, arm64]
11+
binary: bin/cloudcostexplorer
12+
main: ./cmd/cloudcostexplorer
13+
14+
- id: linux #build:linux
15+
goos: [linux]
16+
goarch: [arm, amd64, arm64]
17+
binary: bin/cloudcostexplorer
18+
main: ./cmd/cloudcostexplorer
19+
20+
- id: windows #build:windows
21+
goos: [windows]
22+
goarch: [amd64, arm64]
23+
binary: bin/cloudcostexplorer
24+
main: ./cmd/cloudcostexplorer
25+
26+
archives:
27+
- format: tar.gz
28+
# this name template makes the OS and Arch compatible with the results of uname.
29+
name_template: >-
30+
{{ .ProjectName }}_
31+
{{- title .Os }}_
32+
{{- if eq .Arch "amd64" }}x86_64
33+
{{- else }}{{ .Arch }}{{ end }}
34+
{{- if .Arm }}v{{ .Arm }}{{ end }}
35+
# use zip for windows archives
36+
format_overrides:
37+
- goos: windows
38+
format: zip
39+
checksum:
40+
name_template: 'checksums.txt'
41+
snapshot:
42+
name_template: "{{ incpatch .Version }}-next"
43+
changelog:
44+
sort: asc
45+
filters:
46+
exclude:
47+
- '^docs:'
48+
- '^test:'
49+
50+
# The lines beneath this are called `modelines`. See `:help modeline`
51+
# Feel free to remove those if you don't want/use them.
52+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
53+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Rangel Reale
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# cloudcostexplorer
2+
3+
## Install
4+
5+
```shell
6+
go install github.com/rrgmc/cloudcostexplorer/cmd/cloudcostexplorer@latest
7+
```
8+
9+
## Author
10+
11+
Rangel Reale ([email protected])

Taskfile.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: '3'
2+
3+
tasks:
4+
current-version:
5+
cmds:
6+
- 'echo "Version: {{.GIT_TAG_CURRENT}}"'
7+
silent: true
8+
vars:
9+
GIT_TAG_CURRENT:
10+
sh: 'git describe --tags --abbrev=0'
11+
release-version:
12+
cmds:
13+
- 'echo "Version: {{.GIT_TAG_CURRENT}} => {{.VERSION}}"'
14+
- task: release-version-internal
15+
vars:
16+
GIT_TAG_CURRENT:
17+
sh: 'git describe --tags --abbrev=0'
18+
requires:
19+
vars: [VERSION]
20+
preconditions:
21+
- sh: 'test -z "$(git status --porcelain)"'
22+
msg: 'there are uncommited git changes'
23+
silent: true
24+
release-version-internal:
25+
internal: true
26+
prompt: "Creating and pushing tag {{.VERSION}}. Are you sure?"
27+
cmds:
28+
- 'git tag {{.VERSION}}'
29+
- 'git push --tags'
30+
requires:
31+
vars: [VERSION]
32+
silent: true

0 commit comments

Comments
 (0)