.drone.yml (4935B)
1 --- 2 ### Drone configuration file for GoToSocial. 3 ### Connects to https://drone.superseriousbusiness.org to perform testing, linting, and automatic builds/pushes to docker. 4 ### 5 ### For documentation on drone, see: https://docs.drone.io/ 6 ### For documentation on drone docker pipelines in particular: https://docs.drone.io/pipeline/docker/overview/ 7 kind: pipeline 8 type: docker 9 name: default 10 11 steps: 12 # We use golangci-lint for linting. 13 # See: https://golangci-lint.run/ 14 - name: lint 15 image: golangci/golangci-lint:v1.53.1 16 volumes: 17 - name: go-build-cache 18 path: /root/.cache/go-build 19 - name: golangci-lint-cache 20 path: /root/.cache/golangci-lint 21 - name: go-src 22 path: /go 23 commands: 24 - golangci-lint run 25 when: 26 event: 27 include: 28 - pull_request 29 30 - name: test 31 image: golang:1.20.4-alpine 32 volumes: 33 - name: go-build-cache 34 path: /root/.cache/go-build 35 - name: go-src 36 path: /go 37 commands: 38 - apk update --no-cache && apk add git 39 - CGO_ENABLED=0 GTS_DB_TYPE="sqlite" GTS_DB_ADDRESS=":memory:" go test ./... 40 - CGO_ENABLED=0 ./test/envparsing.sh 41 when: 42 event: 43 include: 44 - pull_request 45 46 - name: web-setup 47 image: node:18-alpine 48 when: 49 event: 50 include: 51 - pull_request 52 volumes: 53 - name: yarn_cache 54 path: /tmp/cache 55 commands: 56 - cd web/source 57 - yarn --frozen-lockfile --cache-folder /tmp/cache 58 59 - name: web-lint 60 image: node:18-alpine 61 when: 62 event: 63 include: 64 - pull_request 65 depends_on: 66 - web-setup 67 commands: 68 - cd web/source 69 - yarn run lint 70 71 - name: web-build 72 image: node:18-alpine 73 when: 74 event: 75 include: 76 - pull_request 77 depends_on: 78 - web-setup 79 commands: 80 - cd web/source 81 - yarn run build 82 83 - name: snapshot 84 image: superseriousbusiness/gotosocial-drone-build:0.2.0 # https://github.com/superseriousbusiness/gotosocial-drone-build 85 volumes: 86 - name: go-build-cache 87 path: /root/.cache/go-build 88 - name: docker 89 path: /var/run/docker.sock 90 environment: 91 DOCKER_USERNAME: gotosocial 92 DOCKER_PASSWORD: 93 from_secret: gts_docker_password 94 commands: 95 - git fetch --tags 96 - /go/dockerlogin.sh 97 - goreleaser release --rm-dist --snapshot 98 - docker push superseriousbusiness/gotosocial:snapshot-armv6 && 99 - docker push superseriousbusiness/gotosocial:snapshot-armv7 100 - docker push superseriousbusiness/gotosocial:snapshot-arm64v8 101 - docker push superseriousbusiness/gotosocial:snapshot-amd64 102 - docker manifest create superseriousbusiness/gotosocial:snapshot superseriousbusiness/gotosocial:snapshot-armv6 superseriousbusiness/gotosocial:snapshot-armv7 superseriousbusiness/gotosocial:snapshot-amd64 superseriousbusiness/gotosocial:snapshot-arm64v8 103 - docker manifest push superseriousbusiness/gotosocial:snapshot 104 when: 105 event: 106 include: 107 - push 108 branch: 109 include: 110 - main 111 112 - name: release 113 image: superseriousbusiness/gotosocial-drone-build:0.2.0 # https://github.com/superseriousbusiness/gotosocial-drone-build 114 volumes: 115 - name: go-build-cache 116 path: /root/.cache/go-build 117 - name: docker 118 path: /var/run/docker.sock 119 environment: 120 DOCKER_USERNAME: gotosocial 121 DOCKER_PASSWORD: 122 from_secret: gts_docker_password 123 GITHUB_TOKEN: 124 from_secret: github_token 125 commands: 126 - git fetch --tags 127 - /go/dockerlogin.sh 128 - goreleaser release --rm-dist 129 when: 130 event: 131 include: 132 - tag 133 134 # We can speed up builds significantly by caching build artifacts between runs. 135 # See: https://docs.drone.io/pipeline/docker/syntax/volumes/host/ 136 volumes: 137 - name: go-build-cache 138 host: 139 path: /drone/gotosocial/go-build 140 - name: golangci-lint-cache 141 host: 142 path: /drone/gotosocial/golangci-lint 143 - name: go-src 144 host: 145 path: /drone/gotosocial/go 146 - name: docker 147 host: 148 path: /var/run/docker.sock 149 150 trigger: 151 repo: 152 - superseriousbusiness/gotosocial 153 - NyaaaWhatsUpDoc/gotosocial 154 - f0x52/gotosocial 155 156 --- 157 kind: pipeline 158 type: docker 159 name: cron 160 161 trigger: 162 event: 163 - cron 164 cron: 165 - nightly 166 167 clone: 168 disable: true 169 170 steps: 171 - name: mirror 172 image: superseriousbusiness/gotosocial-drone-build:0.2.0 173 environment: 174 ORIGIN_REPO: https://github.com/superseriousbusiness/gotosocial 175 TARGET_REPO: https://codeberg.org/superseriousbusiness/gotosocial 176 CODEBERG_USER: gotosocialbot 177 CODEBERG_EMAIL: admin@gotosocial.org 178 CODEBERG_TOKEN: 179 from_secret: gts_codeberg_token 180 commands: 181 - /go/codeberg_clone.sh 182 183 --- 184 kind: signature 185 hmac: 946c2ffd4e79de07a767ec06ebac0a8ca70a03ce5666aae093c9b0af455041d1 186 187 ...