diff --git a/.drone.yml b/.drone.yml index d0cebc0..2360eae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -73,7 +73,7 @@ steps: pull: always image: golang:1.13 commands: - - "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram" + - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram environment: CGO_ENABLED: 0 when: @@ -85,7 +85,7 @@ steps: pull: always image: golang:1.13 commands: - - "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram" + - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-telegram environment: CGO_ENABLED: 0 when: @@ -133,8 +133,8 @@ steps: trigger: ref: - refs/heads/master - - "refs/pull/**" - - "refs/tags/**" + - refs/pull/** + - refs/tags/** depends_on: - testing @@ -152,7 +152,7 @@ steps: pull: always image: golang:1.13 commands: - - "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram" + - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram environment: CGO_ENABLED: 0 when: @@ -164,7 +164,7 @@ steps: pull: always image: golang:1.13 commands: - - "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram" + - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm64/drone-telegram environment: CGO_ENABLED: 0 when: @@ -212,8 +212,8 @@ steps: trigger: ref: - refs/heads/master - - "refs/pull/**" - - "refs/tags/**" + - refs/pull/** + - refs/tags/** depends_on: - testing @@ -231,7 +231,7 @@ steps: pull: always image: golang:1.13 commands: - - "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram" + - go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram environment: CGO_ENABLED: 0 when: @@ -243,7 +243,7 @@ steps: pull: always image: golang:1.13 commands: - - "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram" + - go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/arm/drone-telegram environment: CGO_ENABLED: 0 when: @@ -291,8 +291,8 @@ steps: trigger: ref: - refs/heads/master - - "refs/pull/**" - - "refs/tags/**" + - refs/pull/** + - refs/tags/** depends_on: - testing @@ -322,14 +322,14 @@ steps: api_key: from_secret: github_release_api_key files: - - "dist/release/*" + - dist/release/* when: event: - tag trigger: ref: - - "refs/tags/**" + - refs/tags/** depends_on: - testing @@ -343,6 +343,16 @@ platform: arch: amd64 steps: +- name: telegram + pull: always + image: appleboy/drone-telegram:1.3.1 + settings: + message: "{{#success build.status}} āœ… Build #{{build.number}} of `{{repo.name}}` succeeded.\n\nšŸ“ Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\nšŸŒ {{ build.link }} {{else}} āŒ Build #{{build.number}} of `{{repo.name}}` failed.\n\nšŸ“ Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\nšŸŒ {{ build.link }} {{/success}}\n" + to: + from_secret: telegram_to + token: + from_secret: telegram_token + - name: manifest pull: always image: plugins/manifest @@ -364,7 +374,7 @@ steps: trigger: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** depends_on: - linux-amd64 diff --git a/pipeline.libsonnet b/pipeline.libsonnet index 16c6ec4..1943779 100644 --- a/pipeline.libsonnet +++ b/pipeline.libsonnet @@ -230,6 +230,16 @@ arch: arch, }, steps: [ + { + name: 'telegram', + image: 'appleboy/drone-telegram:1.3.1', + pull: 'always', + settings: { + to: { from_secret: 'telegram_to' }, + token: { from_secret: 'telegram_token' }, + message: '{{#success build.status}} āœ… Build #{{build.number}} of `{{repo.name}}` succeeded.\n\nšŸ“ Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\nšŸŒ {{ build.link }} {{else}} āŒ Build #{{build.number}} of `{{repo.name}}` failed.\n\nšŸ“ Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit. message}} ```\n\nšŸŒ {{ build.link }} {{/success}}\n', + }, + }, { name: 'manifest', image: 'plugins/manifest',