Skip to content

Commit

Permalink
Update CI/CD pipelines, deps, build procedures (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.dev>
  • Loading branch information
teran authored Jun 30, 2024
1 parent 641103d commit cc3e3eb
Show file tree
Hide file tree
Showing 14 changed files with 307 additions and 165 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...
3. ...
4. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE REQUEST] "
labels: enhancement
assignees: ''

---

**What is your use case?**
What real problem are you trying to solve?

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: release

on:
push:
tags:
- 'v*'

jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: articulate/actions-markdownlint@v1

unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Test with the Go CLI
run: go test ./...
- name: Build
run: go build -v ./...

build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs:
- markdownlint
- unittests
steps:
- name: Define build timestamp
id: timestamp
run: echo "::set-output name=now::$(date -u +'%Y%m%d%H%M%S')"
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Build & Publish release release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: verify

on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: articulate/actions-markdownlint@v1

unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Test with the Go CLI
run: go test ./...

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
- name: Install dependencies
run: go mod download
- name: Build project against .goreleaser.yaml
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
version: 2
builds:
- id: checksum
main: ./
binary: checksum
ldflags:
- -s -w -X main.appVersion={{.Version}} -X main.buildTimestamp={{.Date}}
env:
- CGO_ENABLED=0
goos:
- darwin
- dragonfly
- freebsd
- linux
- netbsd
- openbsd
- solaris
- windows
goarch:
# x86
- amd64
- "386"

# ARM
- arm64
- arm

# MIPS
- mips64
- mips64le
- mips
- mipsle
goamd64: ["v1", "v2", "v3"]
goarm: ["6", "7"]
gomips: ["hardfloat", "softfloat"]
mod_timestamp: "{{ .CommitTimestamp }}"
archives:
- format: binary
checksum:
name_template: "checksums.txt"
algorithm: sha256
split: false
disable: false
75 changes: 0 additions & 75 deletions .goreleaser.yml

This file was deleted.

45 changes: 0 additions & 45 deletions Makefile

This file was deleted.

Loading

0 comments on commit cc3e3eb

Please sign in to comment.