github.com/goreleaser/goreleaser@v1.25.1/www/docs/ci/semaphore.md (about) 1 # Semaphore 2 3 In [Semaphore 2.0](https://semaphoreci.com) each project starts with the 4 default pipeline specified in `.semaphore/semaphore.yml`. 5 6 ```yaml 7 # .semaphore/semaphore.yml. 8 version: v1.0 9 name: Build 10 agent: 11 machine: 12 type: e1-standard-2 13 os_image: ubuntu1804 14 15 blocks: 16 - name: "Test" 17 task: 18 prologue: 19 commands: 20 # set go version 21 - sem-version go 1.11 22 - "export GOPATH=~/go" 23 - "export PATH=/home/semaphore/go/bin:$PATH" 24 - checkout 25 26 jobs: 27 - name: "Lint" 28 commands: 29 - go get ./... 30 - go test ./... 31 32 # On Semaphore 2.0 deployment and delivery is managed with promotions, 33 # which may be automatic or manual and optionally depend on conditions. 34 promotions: 35 - name: Release 36 pipeline_file: goreleaser.yaml 37 auto_promote_on: 38 - result: passed 39 branch: 40 - "^refs/tags/v*" 41 ``` 42 43 Pipeline file in `.semaphore/goreleaser.yaml`: 44 45 ```yaml 46 version: "v1.0" 47 name: GoReleaser 48 agent: 49 machine: 50 type: e1-standard-2 51 os_image: ubuntu1804 52 blocks: 53 - name: "Release" 54 task: 55 secrets: 56 - name: goreleaser 57 prologue: 58 commands: 59 - sem-version go 1.11 60 - "export GOPATH=~/go" 61 - "export PATH=/home/semaphore/go/bin:$PATH" 62 - checkout 63 jobs: 64 - name: goreleaser 65 commands: 66 - curl -sfL https://goreleaser.com/static/run | bash 67 ``` 68 69 The following YAML file, `createSecret.yml` creates a new secret item that is 70 called GoReleaser with one environment variable, named `GITHUB_TOKEN`: 71 72 ```yaml 73 apiVersion: v1alpha 74 kind: Secret 75 metadata: 76 name: goreleaser 77 data: 78 env_vars: 79 - name: GITHUB_TOKEN 80 value: "your token here" 81 ``` 82 83 Check [Managing Secrets](https://docs.semaphoreci.com/article/51-secrets-yaml-reference) 84 for more detailed documentation.