-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
90 additions
and
61 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# debug info about this machine | ||
- run: uname -a | ||
- run: free | ||
- run: env | ||
- run: mount | ||
- run: lscpu | ||
- run: lsmem | ||
- run: lsblk | ||
- run: lspci | ||
- run: lsipc | ||
- run: whoami | ||
|
||
# Get the code | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --all --tags | ||
- run: top -b -n 1 | head -n5 | ||
|
||
# Go | ||
- uses: actions/setup-go@v2 | ||
- run: go version | ||
- run: go env | ||
- run: go get -v . | ||
- run: go build | ||
- run: ./build_all.sh | ||
|
||
# # Zig | ||
- uses: goto-bus-stop/setup-zig@v1 | ||
with: | ||
version: "0.10.0-dev.1860+7b090df66" | ||
- run: zig version | ||
- run: zig env | ||
- uses: nektro/actions-setup-zigmod@v1 | ||
- run: zigmod version | ||
|
||
# Github Release | ||
- run: ./changelog.sh | ||
- run: zigmod aq install 1/nektro/ghr | ||
- run: ./make_release.sh ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Docker image | ||
- run: echo "RELEASE_NUM=$(./release_num.sh)" >> $GITHUB_ENV | ||
- run: echo ${{ env.RELEASE_NUM }} | ||
- uses: docker/build-push-action@v1 | ||
with: | ||
username: nektro | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
repository: ${{ env.GITHUB_REPOSITORY }} | ||
tags: latest,r${{ env.RELEASE_NUM }} |
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,19 +1,5 @@ | ||
FROM golang:alpine as golang | ||
WORKDIR /app | ||
COPY . . | ||
ARG BUILD_NUM | ||
RUN apk add --no-cache git libc-dev musl-dev build-base gcc ca-certificates \ | ||
&& export GO_VERSION=$(go version | cut -d' ' -f3) \ | ||
&& export VCS_REF="v${BUILD_NUM}-docker-$GO_VERSION" \ | ||
&& echo $VCS_REF \ | ||
&& go get -v . \ | ||
&& go install -v github.com/rakyll/statik \ | ||
&& $GOPATH/bin/statik -src="./www/" \ | ||
&& CGO_ENABLED=1 go build -ldflags "-s -w -X main.Version=$VCS_REF" . | ||
|
||
FROM alpine | ||
COPY --from=golang /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=golang /app/mantle /app/mantle | ||
|
||
WORKDIR /app | ||
COPY ./bin/mantle-linux-amd64 /app/mantle | ||
VOLUME /data | ||
ENTRYPOINT ["/app/mantle", "--port", "8000", "--config", "/data/config.json"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
date=$(date +'%Y%m%d') | ||
version=${CIRCLE_BUILD_NUM-$date} | ||
tag=v$version | ||
go get -v -u github.com/tcnksm/ghr | ||
$GOPATH/bin/ghr \ | ||
set -e | ||
|
||
tag=r$(./release_num.sh) | ||
|
||
GITHUB_TOKEN="$1" | ||
PROJECT_USERNAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f1) | ||
PROJECT_REPONAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2) | ||
|
||
~/.zigmod/bin/ghr \ | ||
-t ${GITHUB_TOKEN} \ | ||
-u ${CIRCLE_PROJECT_USERNAME} \ | ||
-r ${CIRCLE_PROJECT_REPONAME} \ | ||
-u ${PROJECT_USERNAME} \ | ||
-r ${PROJECT_REPONAME} \ | ||
-b "$(./changelog.sh)" \ | ||
"$tag" \ | ||
"./bin/" |
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
tagcount=$(git tag | wc -l) | ||
tagcount=$((tagcount+1)) | ||
|
||
echo $tagcount |