Skip to content

Commit 43dce69

Browse files
committed
fix: update build script
1 parent 4c53eb9 commit 43dce69

File tree

6 files changed

+27
-22
lines changed

6 files changed

+27
-22
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ ROADMAP.md
77
build
88
.env
99
data.db
10-
app/node_modules
10+
app/node_modules
11+
app/build

.github/workflows/release.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,22 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: '16'
14+
- uses: actions/setup-go@v2
15+
with:
16+
go-version: '^1.17.3'
1117
- name: Install dependencies
1218
run: |
1319
sudo apt-get install build-essential wget zip gcc-mingw-w64 && \
14-
sudo apt-get remove --auto-remove golang-go && \
15-
sudo rm -rf /usr/bin/go &&\
16-
wget --progress=dot:mega https://golang.org/dl/go1.17.1.linux-amd64.tar.gz -O go-linux.tar.gz && \
17-
sudo tar -zxf go-linux.tar.gz && \
18-
sudo mv go /usr/bin/ && \
19-
sudo mkdir -p /go/bin /go/src /go/pkg && \
20-
export GO_HOME=/usr/bin/go && \
21-
export GOPATH=/go && \
22-
export PATH=${GOPATH}/bin:${GO_HOME}/bin/:$PATH && \
23-
echo "/usr/bin/go/bin" >> $GITHUB_PATH
24-
echo "/usr/bin/x86_64-w64-mingw32-gcc" >> GITHUB_PATH
25-
go version && \
20+
echo "/usr/bin/x86_64-w64-mingw32-gcc" >> GITHUB_PATH && \
2621
wget --no-check-certificate --progress=dot:mega https://github.com/wangyoucao577/assets-uploader/releases/download/v0.3.0/github-assets-uploader-v0.3.0-linux-amd64.tar.gz -O github-assets-uploader.tar.gz && \
2722
tar -zxf github-assets-uploader.tar.gz && \
2823
sudo mv github-assets-uploader /usr/sbin/ && \
2924
sudo rm -f github-assets-uploader.tar.gz && \
30-
github-assets-uploader -version
25+
github-assets-uploader -version && \
26+
make build-app
3127
- name: Print Go paths
3228
run: whereis go
3329
- name: Print Go Version

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ server/server
22
server/.env
33
data
44
app/node_modules
5+
app/build
56
build
67
.env
78
data.db

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
FROM golang:1.17-alpine as builder
2-
WORKDIR /app
1+
FROM golang:1.17-alpine as go-builder
2+
WORKDIR /authorizer
33
COPY server server
44
COPY Makefile .
55

66
ARG VERSION="latest"
77
ENV VERSION="$VERSION"
88

99
RUN echo "$VERSION"
10-
RUN apk add build-base nodejs &&\
10+
RUN apk add build-base &&\
1111
make clean && make && \
1212
chmod 777 build/server
1313

14+
FROM node:17-alpine3.12 as node-builder
15+
WORKDIR /authorizer
16+
COPY app app
17+
COPY Makefile .
18+
RUN apk add build-base &&\
19+
make build-app
20+
1421
FROM alpine:latest
15-
RUN apk --no-cache add ca-certificates
1622
WORKDIR /root/
17-
COPY app app
23+
RUN mkdir app
24+
COPY --from=node-builder /authorizer/app/build app/build
25+
COPY --from=go-builder /authorizer/build build
1826
COPY templates templates
19-
COPY --from=builder /app/build build
2027
EXPOSE 8080
2128
CMD [ "./build/server" ]

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"author": "Lakhan Samani",
1212
"license": "ISC",
1313
"dependencies": {
14-
"@authorizerdev/authorizer-react": "^0.3.0",
14+
"@authorizerdev/authorizer-react": "latest",
1515
"@types/react": "^17.0.15",
1616
"@types/react-dom": "^17.0.9",
1717
"esbuild": "^0.12.17",

scripts/build-mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION="$1"
2-
make clean && CGO_ENABLED=1 VERSION=${VERSION} make
2+
make clean && make build-app && CGO_ENABLED=1 VERSION=${VERSION} make
33
FILE_NAME=authorizer-${VERSION}-darwin-amd64.tar.gz
44
tar cvfz ${FILE_NAME} .env app/build build templates
55
AUTH="Authorization: token $GITHUB_TOKEN"

0 commit comments

Comments
 (0)