Skip to content

Commit

Permalink
bump versions go and goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
kpym committed Apr 25, 2023
1 parent 9508f69 commit 9c9acea
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# the configuration of goreleaser is in
# .goreleaser.yml in the root folder

# workflow name
name: goreleaser

# on events

on:
push:
tags:
Expand All @@ -16,19 +15,23 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Fetch tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: stable
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 12 additions & 14 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: serve
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
ldflags:
- -s -w -X main.version={{.Version}}
archives:
- replacements:
darwin: MacOS
linux: Linux
windows: Windows
386: 32bit
amd64: 64bit
-
name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- if eq .Os "darwin" }}MacOS
{{- else if eq .Os "linux" }}Linux
{{- else if eq .Os "windows" }}Windows
{{- else }}{{ .Os }}
{{- end }}_
{{- if eq .Arch "amd64" }}64bit
{{- else if eq .Arch "386" }}32bit
{{- else }}{{ .Arch }}
{{- end }}
format_overrides:
- goos: windows
format: zip
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Or if there is piped data it will be served.
2022/07/07 14:33:55 [serve] Request: /
2022/07/07 14:33:55 [serve] Serve piped data at root.
```
Only two flags are available:
Only two flags are available:

- `-p` : choose the port to use. If not set the first available after `8080` will be used.
```bash
> serve -p 8888
2022/07/07 14:34:56 [serve] Start serving the current folder at http://localhost:8888.
2022/07/07 14:34:56 [serve] Request: /
```
- `-t` : serve at the given path
- `-t` : serve at the given path
```bash
> serve -t 'foo'
2022/07/07 14:36:54 [serve] Start serving at http://localhost:8080/foo/.
Expand All @@ -52,7 +52,7 @@ After cloning this repo you can compile the sources with [goreleaser](https://gi

```
git clone https://github.com/kpym/lol.git .
goreleaser --snapshot --skip-publish --rm-dist
goreleaser --snapshot --skip-publish --clean
```
You will find the resulting binaries in the `dist/` sub-folder.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/kpym/serve

go 1.18
go 1.20

0 comments on commit 9c9acea

Please sign in to comment.