mirror of
https://github.com/drone-plugins/drone-download.git
synced 2026-06-04 18:24:21 +08:00
Create .drone.yml
This commit is contained in:
+255
@@ -0,0 +1,255 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: vm
|
||||||
|
name: testing
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
pool:
|
||||||
|
use: ubuntu
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: lint
|
||||||
|
image: golang:1.19
|
||||||
|
pull: always
|
||||||
|
commands:
|
||||||
|
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||||
|
- golangci-lint version
|
||||||
|
- golangci-lint run
|
||||||
|
volumes:
|
||||||
|
- name: gopath
|
||||||
|
path: "/go"
|
||||||
|
- name: test
|
||||||
|
image: golang:1.19
|
||||||
|
commands:
|
||||||
|
- go test -cover ./...
|
||||||
|
volumes:
|
||||||
|
- name: gopath
|
||||||
|
path: "/go"
|
||||||
|
volumes:
|
||||||
|
- name: gopath
|
||||||
|
temp: {}
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
- refs/pull/**
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: vm
|
||||||
|
name: linux-amd64
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
pool:
|
||||||
|
use: ubuntu
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: environment
|
||||||
|
image: golang:1.19
|
||||||
|
pull: always
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go version
|
||||||
|
- go env
|
||||||
|
- name: build
|
||||||
|
image: golang:1.19
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-download .
|
||||||
|
- name: docker
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: docker/Dockerfile.linux.amd64
|
||||||
|
repo: plugins/download
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
auto_tag: true
|
||||||
|
auto_tag_suffix: linux-amd64
|
||||||
|
depends_on:
|
||||||
|
- testing
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
- refs/pull/**
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: linux-arm64
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
pool:
|
||||||
|
use: ubuntu_arm64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: environment
|
||||||
|
image: golang:1.19
|
||||||
|
pull: always
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go version
|
||||||
|
- go env
|
||||||
|
- name: build
|
||||||
|
image: golang:1.19
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-download .
|
||||||
|
- name: docker
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: docker/Dockerfile.linux.arm64
|
||||||
|
repo: plugins/download
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
auto_tag: true
|
||||||
|
auto_tag_suffix: linux-arm64
|
||||||
|
depends_on:
|
||||||
|
- testing
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
- refs/pull/**
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: vm
|
||||||
|
name: windows-1809
|
||||||
|
platform:
|
||||||
|
os: windows
|
||||||
|
arch: amd64
|
||||||
|
pool:
|
||||||
|
use: windows
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: environment
|
||||||
|
image: golang:1.19
|
||||||
|
pull: always
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go version
|
||||||
|
- go env
|
||||||
|
- name: build
|
||||||
|
image: golang:1.19
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-download.exe .
|
||||||
|
- name: docker
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: docker/Dockerfile.windows.1809
|
||||||
|
repo: plugins/download
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
auto_tag: true
|
||||||
|
auto_tag_suffix: windows-1809-amd64
|
||||||
|
daemon_off: true
|
||||||
|
purge: false
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
depends_on:
|
||||||
|
- testing
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
- refs/pull/**
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: vm
|
||||||
|
name: windows-ltsc2022
|
||||||
|
platform:
|
||||||
|
os: windows
|
||||||
|
arch: amd64
|
||||||
|
pool:
|
||||||
|
use: windows-2022
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: environment
|
||||||
|
image: golang:1.19
|
||||||
|
pull: always
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go version
|
||||||
|
- go env
|
||||||
|
- name: build
|
||||||
|
image: golang:1.19
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: '0'
|
||||||
|
commands:
|
||||||
|
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-download.exe .
|
||||||
|
- name: docker
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: docker/Dockerfile.windows.ltsc2022
|
||||||
|
repo: plugins/download
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
auto_tag: true
|
||||||
|
auto_tag_suffix: windows-ltsc2022-amd64
|
||||||
|
daemon_off: true
|
||||||
|
purge: false
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
depends_on:
|
||||||
|
- testing
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
|
- refs/pull/**
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: vm
|
||||||
|
name: manifest
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
pool:
|
||||||
|
use: ubuntu
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: manifest
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
auto_tag: 'true'
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
spec: docker/manifest.tmpl
|
||||||
|
ignore_missing: true
|
||||||
|
depends_on:
|
||||||
|
- linux-amd64
|
||||||
|
- linux-arm64
|
||||||
|
- windows-1809
|
||||||
|
- windows-ltsc2022
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/**
|
||||||
Reference in New Issue
Block a user