Advertisement
zergon321

go-ci

Sep 24th, 2021
1,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.18 KB | None | 0 0
  1. image: golang:1.16-alpine
  2.  
  3. variables:
  4.  # Please edit to your GitLab project
  5.   REPO_NAME: danmaku
  6.  
  7. # The problem is that to be able to use go get, one needs to put
  8. # the repository in the $GOPATH. So for example if your gitlab domain
  9. # is gitlab.com, and that your repository is namespace/project, and
  10. # the default GOPATH being /go, then you'd need to have your
  11. # repository in /go/src/gitlab.com/namespace/project
  12. # Thus, making a symbolic link corrects this.
  13. before_script:
  14.  - mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
  15.   - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
  16.   - cd $GOPATH/src/$REPO_NAME
  17.  
  18. stages:
  19.  - build
  20.   - bundle
  21.  
  22. compile:
  23.   stage: build
  24.   script:
  25.    - apk add build-base
  26.     - apk add libx11-dev
  27.     - apk add libxrandr-dev
  28.     - apk add libxinerama-dev
  29.     - apk add libxcursor-dev
  30.     - apk add libxi-dev
  31.     - apk add alsa-lib-dev
  32.     - apk add mesa-dev
  33.     - go mod download
  34.     - go build -ldflags "-s -w" -o $CI_PROJECT_DIR/danmaku
  35.   artifacts:
  36.     paths:
  37.      - danmaku
  38.  
  39. pack:
  40.   stage: bundle
  41.   script:
  42.    - echo "Hello, world!"
  43.   artifacts:
  44.     paths:
  45.      - bossfight.res
  46.       - common.res
  47.       - danmaku
  48.       - config.ini
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement