Skip to content

Commit 0876ae7

Browse files
committed
first
Signed-off-by: Carlos Alexandro Becker <[email protected]>
0 parents  commit 0876ae7

File tree

8 files changed

+155
-0
lines changed

8 files changed

+155
-0
lines changed

.github/dependabot.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "08:00"
8+
labels:
9+
- "dependencies"
10+
commit-message:
11+
prefix: "chore"
12+
include: "scope"
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"
17+
time: "08:00"
18+
labels:
19+
- "dependencies"
20+
commit-message:
21+
prefix: "chore"
22+
include: "scope"
23+
- package-ecosystem: "docker"
24+
directory: "/"
25+
schedule:
26+
interval: "daily"
27+
time: "08:00"
28+
labels:
29+
- "dependencies"
30+
commit-message:
31+
prefix: "chore"
32+
include: "scope"

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "v*"
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-go@v2
21+
with:
22+
go-version: stable
23+
- run: go mod tidy
24+
- run: go test -v ./...
25+
- uses: docker/login-action@v1
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.repository_owner }}
29+
password: ${{ secrets.GH_PAT }}
30+
- uses: goreleaser/goreleaser-action@v6
31+
if: success() && startsWith(github.ref, 'refs/tags/') # only on tags
32+
with:
33+
distribution: pro
34+
version: latest
35+
args: release --clean
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
dependabot:
39+
needs: [build]
40+
runs-on: ubuntu-latest
41+
permissions:
42+
pull-requests: write
43+
contents: write
44+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
45+
steps:
46+
- id: metadata
47+
uses: dependabot/fetch-metadata@v2
48+
with:
49+
github-token: "${{ secrets.GITHUB_TOKEN }}"
50+
- run: |
51+
gh pr review --approve "$PR_URL"
52+
gh pr merge --squash --auto "$PR_URL"
53+
env:
54+
PR_URL: ${{github.event.pull_request.html_url}}
55+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.goreleaser.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
2+
# vim: set ts=2 sw=2 tw=0 fo=jcroql
3+
version: 2
4+
pro: true
5+
6+
project_name: example
7+
8+
builds:
9+
- env: [CGO_ENABLED=0]
10+
goos:
11+
- linux
12+
- windows
13+
- darwin
14+
goarch:
15+
- amd64
16+
- arm64
17+
18+
npms:
19+
- name: "@goreleaser/example"
20+
repository: https://github.com/goreleaser/example-npm
21+
bugs: https://github.com/goreleaser/example-npm/issues
22+
description: Example NPM publish pipeline
23+
homepage: https://goreleaser.com
24+
license: MIT
25+
author: "Carlos Alexandro Becker <[email protected]>"
26+
keywords:
27+
- goreleaser
28+
- example

LICENSE.md

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) 2025 Carlos Alexandro Becker
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# example-npm
2+
3+
GoReleaser example using GitHub and publishing to NPM.

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/goreleaser/example
2+
3+
go 1.19

main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"runtime"
6+
)
7+
8+
var version = "dev"
9+
10+
func main() {
11+
fmt.Println("hello world, github! (", version, runtime.GOOS, runtime.GOARCH, ")")
12+
}

0 commit comments

Comments
 (0)