Skip to content

Commit df27622

Browse files
committed
chore: add build config files
1 parent bc5e419 commit df27622

File tree

7 files changed

+119
-1
lines changed

7 files changed

+119
-1
lines changed

.github/workflows/pull-request.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pull Request Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- name: Set up Go
14+
uses: actions/setup-go@v3
15+
with:
16+
go-version: 1.18
17+
id: go
18+
- name: Run GoReleaser
19+
uses: goreleaser/goreleaser-action@v4.1.1
20+
with:
21+
github_token: ${{ secrets.GH_PUBLISH_SECRETS }}
22+
version: v1.14.0
23+
args: release --skip-publish --rm-dist --snapshot

.github/workflows/release-drafter.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
UpdateReleaseDraft:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3.0.0
14+
- name: Unshallow
15+
run: git fetch --prune --unshallow
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.18
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v4.1.1
22+
with:
23+
github_token: ${{ secrets.GH_PUBLISH_SECRETS }}
24+
version: v1.14.0
25+
args: release --rm-dist
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
release/
2+
bin/

.goreleaser.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Official documentation at http://goreleaser.com
2+
project_name: md-exec
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
binary: mde
7+
goarch:
8+
- amd64
9+
goos:
10+
- windows
11+
- linux
12+
- darwin
13+
ignore:
14+
- goos: windows
15+
goarch: arm
16+
- goos: windows
17+
goarch: arm64
18+
- goos: darwin
19+
goarch: arm
20+
ldflags:
21+
- -w
22+
- -s
23+
dist: release
24+
archives:
25+
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
26+
replacements:
27+
darwin: darwin
28+
linux: linux
29+
windows: windows
30+
amd64: amd64
31+
arm64: arm64
32+
format_overrides:
33+
- goos: windows
34+
format: zip
35+
files:
36+
- README.md
37+
checksum:
38+
name_template: 'checksums.txt'
39+
snapshot:
40+
name_template: "{{ .Tag }}-next-{{.ShortCommit}}"
41+
changelog:
42+
skip: true
43+
sort: asc
44+
filters:
45+
exclude:
46+
- '^docs:'
47+
- '^test:'

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build:
2+
CGO_ENABLE=0 go build -ldflags "-w -s" -o bin/mde
3+
copy: build
4+
cp bin/mde /usr/local/bin
5+

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/linuxsuren/md-exec
22

3-
go 1.19
3+
go 1.18
44

55
require github.com/golang-commonmark/markdown v0.0.0-20180910011815-a8f139058164
66

0 commit comments

Comments
 (0)