-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add goreleaser config * update go.mod / gitignore * dev/cross cleanup * switch to cgo-less sqlite driver * workflows * fix build workflow Co-authored-by: BuckarooBanzay <[email protected]>
- Loading branch information
1 parent
e7b0b74
commit ddb5267
Showing
22 changed files
with
279 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Set up nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '17' | ||
|
||
- name: Create frontend bundle | ||
run: cd public && npm ci && npm run bundle | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Tests | ||
run: | | ||
go mod tidy | ||
go test -v ./... | ||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mapserver | ||
output | ||
test-output | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
targets: | ||
- linux_amd64 | ||
- windows_amd64 | ||
- darwin_arm64 | ||
- linux_arm_6 | ||
ldflags: | ||
- -s -w -X mapserver/app.Version={{.Version}} | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
dockers: | ||
- image_templates: ["minetestmapserver/mapserver:{{ .Version }}"] | ||
dockerfile: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
FROM golang:1.17.6-alpine as builder | ||
|
||
RUN apk --no-cache add ca-certificates gcc libc-dev nodejs npm git make | ||
|
||
VOLUME /root/go | ||
COPY ./ /server | ||
RUN cd /server &&\ | ||
npm install -g jshint rollup &&\ | ||
make test jshint all | ||
|
||
FROM alpine:3.15.0 | ||
RUN apk --no-cache add ca-certificates curl | ||
WORKDIR /app | ||
COPY --from=builder /server/output/mapserver-linux-x86_64 /bin/mapserver | ||
|
||
HEALTHCHECK --interval=5s --timeout=3s \ | ||
CMD curl -f http://localhost:8080/api/config || exit 1 | ||
|
||
FROM scratch | ||
COPY mapserver /bin/mapserver | ||
EXPOSE 8080 | ||
CMD ["/bin/mapserver"] | ||
ENTRYPOINT ["/bin/mapserver"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.