diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..252c202 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,31 @@ +kind: pipeline +name: default + +steps: + - name: test + image: golang:1.16 + commands: + - go fmt $(go list ./... | grep -v /vendor/) + - go vet $(go list ./... | grep -v /vendor/) + - go test -race $(go list ./... | grep -v /vendor/) + + - name: build + image: golang:1.16 + commands: + - cp /etc/ssl/certs/ca-certificates.crt . + - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o rbxcompiler ./cmd/rbxcompiler + + - name: push-production + image: plugins/docker:19 + settings: + username: + from_secret: REGISTRY_USER + password: + from_secret: REGISTRY_PASSWORD + registry: registry.itzana.me + repo: registry.itzana.me/public/rbxcompiler + tags: + - latest + when: + branch: + - release \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d801895..1676db7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,13 @@ image: golang:1.14.2 variables: - REPO_NAME: ci.itzana.me/qtdb/rbxcompile + REPO_NAME: git.itzana.me/qtdb/rbxcompile before_script: - mkdir -p $GOPATH/src/$(dirname $REPO_NAME) - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME - cd $GOPATH/src/$REPO_NAME - - echo -e "machine ci.itzana.me login gitlab-ci-token password ${CI_JOB_TOKEN}" > ~/.netrc + - echo -e "machine git.itzana.me login gitlab-ci-token password ${CI_JOB_TOKEN}" > ~/.netrc stages: - test diff --git a/Dockerfile b/Dockerfile index b971f52..5b83189 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM alpine:latest - -RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* - -COPY rbxcompiler /bin/rbxcompiler +FROM scratch +COPY ca-certificates.crt /etc/ssl/certs/ +COPY rbxcompiler / +CMD ["/rbxcompiler"] \ No newline at end of file diff --git a/cmd/rbxcompiler/rbxcompiler.go b/cmd/rbxcompiler/rbxcompiler.go index 793966d..71a0084 100644 --- a/cmd/rbxcompiler/rbxcompiler.go +++ b/cmd/rbxcompiler/rbxcompiler.go @@ -2,10 +2,10 @@ package main import ( "bytes" - "ci.itzana.me/itzaname/go-roblox" - "ci.itzana.me/itzaname/rbxcompiler/internal/rbxbuilder" "flag" "fmt" + "git.itzana.me/itzaname/go-roblox" + "git.itzana.me/itzaname/rbxcompiler/internal/rbxbuilder" "os" ) diff --git a/go.mod b/go.mod index 0057487..dabd606 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ -module ci.itzana.me/itzaname/rbxcompiler +module git.itzana.me/itzaname/rbxcompiler go 1.15 require ( - ci.itzana.me/itzaname/go-roblox v0.0.0-20210317124602-a09b6e34a37c - ci.itzana.me/itzaname/rbxfile v0.0.0-20200929185118-23ef9783a53e + git.itzana.me/itzaname/go-roblox v0.0.0-20210810235437-3574e3d70d92 + git.itzana.me/itzaname/rbxfile v0.0.0-20210811000911-6fc7a2281e8d github.com/google/uuid v1.1.2 ) diff --git a/go.sum b/go.sum index 0e405be..9b5496d 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,9 @@ -ci.itzana.me/itzaname/go-roblox v0.0.0-20200922163025-9652a2630ec6 h1:baGWHDYDYo7Q1P6UYIGW+4zm8YKBFILeOY7ExIADQoM= -ci.itzana.me/itzaname/go-roblox v0.0.0-20200922163025-9652a2630ec6/go.mod h1:ttaofy5pZVEozl+/s5k4y53dk3uorpHUtLWya0VIpZ0= -ci.itzana.me/itzaname/go-roblox v0.0.0-20210317124151-41119b5966c7 h1:+bfCaO9BiKmJ6MXiglCg4FmcyrPdU1fUeB6ZiH37xA0= -ci.itzana.me/itzaname/go-roblox v0.0.0-20210317124151-41119b5966c7/go.mod h1:ttaofy5pZVEozl+/s5k4y53dk3uorpHUtLWya0VIpZ0= -ci.itzana.me/itzaname/go-roblox v0.0.0-20210317124602-a09b6e34a37c h1:ytOJfGKzrty/i8G7HoAQlzANz3qtrcxE4QUt63nGSpY= -ci.itzana.me/itzaname/go-roblox v0.0.0-20210317124602-a09b6e34a37c/go.mod h1:ttaofy5pZVEozl+/s5k4y53dk3uorpHUtLWya0VIpZ0= -ci.itzana.me/itzaname/rbxapi v0.1.0 h1:8tMoEvelXgxGJd71BXGBpGn/K18mWaWQvCsQqY7lnn4= -ci.itzana.me/itzaname/rbxapi v0.1.0/go.mod h1:CRPbR/U4RqL4rqSGsEaYYr9wld3ctP+vClwgj/wGLsE= -ci.itzana.me/itzaname/rbxfile v0.0.0-20200929185118-23ef9783a53e h1:xLqVw9gkdqKgywmEccJsXIJDM4bDgJ2g86ACe2iA7rA= -ci.itzana.me/itzaname/rbxfile v0.0.0-20200929185118-23ef9783a53e/go.mod h1:YOKNgkzAvSDgoE795RTw/c/kzSxNzVvy12OkY/JcUVw= +git.itzana.me/itzaname/go-roblox v0.0.0-20210810235437-3574e3d70d92 h1:O0we09WIpFm18LSODLVfYvmll6UamygaftHiuHrHMkQ= +git.itzana.me/itzaname/go-roblox v0.0.0-20210810235437-3574e3d70d92/go.mod h1:x+fEejcurT8y/Vq+/ErqDHZm04d9lmYDGxjGpcPvJW4= +git.itzana.me/itzaname/rbxapi v0.1.0 h1:eBKdz34TJ+U6boV97E/NWncnS6LYtlV2sz34v/Sd1X4= +git.itzana.me/itzaname/rbxapi v0.1.0/go.mod h1:QrL2P6VPj7gin7/KhM+86HsZ4TqoPUJ9t5FjoduEYfY= +git.itzana.me/itzaname/rbxfile v0.0.0-20210811000911-6fc7a2281e8d h1:K9qkm1OlnTpKR7jBRYu1lI/Wr7zbTCOYHrWkP1GhnzQ= +git.itzana.me/itzaname/rbxfile v0.0.0-20210811000911-6fc7a2281e8d/go.mod h1:ptm2rTJ8mzC9qWcjOAKtk16Sdhx2bpgn0za4hr9fBf0= github.com/anaminus/but v0.2.0/go.mod h1:44z5qYo/3MWnZDi6ifH3IgrFWa1VFfdTttL3IYN/9R4= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= diff --git a/internal/rbxbuilder/build_place.go b/internal/rbxbuilder/build_place.go index 76e6727..17a3a8e 100644 --- a/internal/rbxbuilder/build_place.go +++ b/internal/rbxbuilder/build_place.go @@ -2,10 +2,10 @@ package rbxbuilder import ( "bytes" - "ci.itzana.me/itzaname/rbxfile" - "ci.itzana.me/itzaname/rbxfile/xml" "encoding/json" "fmt" + "git.itzana.me/itzaname/rbxfile" + "git.itzana.me/itzaname/rbxfile/xml" "os" "path/filepath" "sort" diff --git a/internal/rbxbuilder/build_script.lua.go b/internal/rbxbuilder/build_script.lua.go index c29710c..c72c39f 100644 --- a/internal/rbxbuilder/build_script.lua.go +++ b/internal/rbxbuilder/build_script.lua.go @@ -1,9 +1,9 @@ package rbxbuilder import ( - "ci.itzana.me/itzaname/rbxfile" - "ci.itzana.me/itzaname/rbxfile/xml" "fmt" + "git.itzana.me/itzaname/rbxfile" + "git.itzana.me/itzaname/rbxfile/xml" "os" "path/filepath" "sort" diff --git a/internal/rbxbuilder/dump_place.go b/internal/rbxbuilder/dump_place.go index 9055c86..d75f581 100644 --- a/internal/rbxbuilder/dump_place.go +++ b/internal/rbxbuilder/dump_place.go @@ -2,9 +2,9 @@ package rbxbuilder import ( "bytes" - "ci.itzana.me/itzaname/rbxfile" - "ci.itzana.me/itzaname/rbxfile/xml" "encoding/json" + "git.itzana.me/itzaname/rbxfile" + "git.itzana.me/itzaname/rbxfile/xml" "io/ioutil" "os" "path/filepath" diff --git a/internal/rbxbuilder/util.go b/internal/rbxbuilder/util.go index b22c1de..d271635 100644 --- a/internal/rbxbuilder/util.go +++ b/internal/rbxbuilder/util.go @@ -1,7 +1,7 @@ package rbxbuilder import ( - "ci.itzana.me/itzaname/rbxfile" + "git.itzana.me/itzaname/rbxfile" "github.com/google/uuid" "io/ioutil" "os"