Skip to content

Commit d55cfa3

Browse files
committed
feat(gh): add support for ci and release workflows
1 parent ba50220 commit d55cfa3

File tree

4 files changed

+119
-1
lines changed

4 files changed

+119
-1
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: "ci"
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
go-mod:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Install Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: "1.24"
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 1
22+
- name: Setup environment
23+
run: cp .env.example .env
24+
- name: Check go.mod
25+
run: |
26+
go mod tidy
27+
git diff --exit-code go.mod
28+
golangci-lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 1
34+
- name: Setup environment
35+
run: cp .env.example .env
36+
- name: Run lint
37+
uses: golangci/golangci-lint-action@v2
38+
with:
39+
version: latest

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: "release"
3+
4+
on:
5+
push:
6+
tags:
7+
- v*
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.DISTBUILD_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 1
18+
- name: Setup environment file
19+
run: cp .env.example .env
20+
- name: Install Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: "1.24"
24+
- name: Unshallow
25+
run: git fetch --prune --unshallow
26+
- name: Login to ghcr.io
27+
uses: docker/login-action@v1
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.DISTBUILD_TOKEN }}
32+
- name: Create release
33+
uses: goreleaser/goreleaser-action@v2
34+
with:
35+
version: latest
36+
args: release --clean
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.DISTBUILD_TOKEN }}

.goreleaser.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
builds:
3+
- id: bootstrap
4+
env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- darwin
8+
- linux
9+
- windows
10+
goarch:
11+
- amd64
12+
dir: .
13+
main: bootstrap.go
14+
binary: bootstrap
15+
flags:
16+
- -trimpath
17+
ldflags: -s -w -X main.BuildTime={{.Date}} -X main.CommitID={{.ShortCommit}}
18+
19+
changelog:
20+
sort: asc
21+
filters:
22+
exclude:
23+
- Merge pull request
24+
- Merge branch

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
# bootstrap
1+
# bootstrap
2+
3+
[![Build Status](https://github.com/distbuild/bootstrap/workflows/ci/badge.svg?branch=main&event=push)](https://github.com/distbuild/bootstrap/actions?query=workflow%3Aci)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/distbuild/bootstrap)](https://goreportcard.com/report/github.com/distbuild/bootstrap)
5+
[![License](https://img.shields.io/github/license/distbuild/bootstrap.svg)](https://github.com/distbuild/bootstrap/blob/main/LICENSE)
6+
[![Tag](https://img.shields.io/github/tag/distbuild/bootstrap.svg)](https://github.com/distbuild/bootstrap/tags)
7+
8+
9+
10+
## Introduction
11+
12+
Build bootstrap
13+
14+
15+
16+
## License
17+
18+
Project License can be found [here](LICENSE).

0 commit comments

Comments
 (0)