mirror of
https://github.com/drone-plugins/drone-gitea-release.git
synced 2026-06-16 14:50:24 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca3c0a6314 | |||
| a0f555112f | |||
| bbcd1f18ce | |||
| fee91d3014 | |||
| c7539c8910 | |||
| 420e9f7f28 |
+11
-11
@@ -9,7 +9,7 @@ pool:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: lint
|
- name: lint
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
pull: always
|
pull: always
|
||||||
commands:
|
commands:
|
||||||
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||||
@@ -19,7 +19,7 @@ steps:
|
|||||||
- name: gopath
|
- name: gopath
|
||||||
path: "/go"
|
path: "/go"
|
||||||
- name: test
|
- name: test
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
commands:
|
commands:
|
||||||
- go test -cover ./...
|
- go test -cover ./...
|
||||||
volumes:
|
volumes:
|
||||||
@@ -46,7 +46,7 @@ pool:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: environment
|
- name: environment
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
pull: always
|
pull: always
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
@@ -54,7 +54,7 @@ steps:
|
|||||||
- go version
|
- go version
|
||||||
- go env
|
- go env
|
||||||
- name: build
|
- name: build
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
commands:
|
commands:
|
||||||
@@ -80,7 +80,7 @@ trigger:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: vm
|
||||||
name: linux-arm64
|
name: linux-arm64
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@@ -90,7 +90,7 @@ pool:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: environment
|
- name: environment
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
pull: always
|
pull: always
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
@@ -98,7 +98,7 @@ steps:
|
|||||||
- go version
|
- go version
|
||||||
- go env
|
- go env
|
||||||
- name: build
|
- name: build
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
commands:
|
commands:
|
||||||
@@ -134,7 +134,7 @@ pool:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: environment
|
- name: environment
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
pull: always
|
pull: always
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
@@ -142,7 +142,7 @@ steps:
|
|||||||
- go version
|
- go version
|
||||||
- go env
|
- go env
|
||||||
- name: build
|
- name: build
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
commands:
|
commands:
|
||||||
@@ -184,7 +184,7 @@ pool:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: environment
|
- name: environment
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
pull: always
|
pull: always
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
@@ -192,7 +192,7 @@ steps:
|
|||||||
- go version
|
- go version
|
||||||
- go env
|
- go env
|
||||||
- name: build
|
- name: build
|
||||||
image: golang:1.19
|
image: golang:1.20
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-PR
|
||||||
|
identifier: eventPR
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronegiteareleaseharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: PR
|
||||||
|
spec:
|
||||||
|
number: <+trigger.prNumber>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-Push
|
||||||
|
identifier: eventPush
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronegiteareleaseharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: branch
|
||||||
|
spec:
|
||||||
|
branch: <+trigger.branch>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-Tag
|
||||||
|
identifier: eventTag
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronegiteareleaseharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: tag
|
||||||
|
spec:
|
||||||
|
tag: <+trigger.tag>
|
||||||
@@ -0,0 +1,383 @@
|
|||||||
|
pipeline:
|
||||||
|
name: drone-gitea-release-harness
|
||||||
|
identifier: dronegiteareleaseharness
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
orgIdentifier: default
|
||||||
|
tags: {}
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
connectorRef: GitHub_Drone_Plugins_Org
|
||||||
|
repoName: drone-gitea-release
|
||||||
|
build: <+input>
|
||||||
|
sparseCheckout: []
|
||||||
|
stages:
|
||||||
|
- stage:
|
||||||
|
name: Testing Stage
|
||||||
|
identifier: Testing_Stage
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: Lint
|
||||||
|
identifier: Lint
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.20
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||||
|
golangci-lint version
|
||||||
|
golangci-lint run
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: Test
|
||||||
|
identifier: Run_1
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.20
|
||||||
|
shell: Sh
|
||||||
|
command: go test -cover ./...
|
||||||
|
description: ""
|
||||||
|
- parallel:
|
||||||
|
- stage:
|
||||||
|
name: linux-amd64
|
||||||
|
identifier: linuxamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
name: Build binaries
|
||||||
|
identifier: Build_binaries
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.20
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
# force go modules
|
||||||
|
export GOPATH=""
|
||||||
|
|
||||||
|
# disable cgo
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# linux
|
||||||
|
export GOOS=linux GOARCH=amd64
|
||||||
|
go build -v -a -tags netgo -o release/linux/amd64/drone-gitea-release .
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerPlugin
|
||||||
|
identifier: BuildAndPushDockerPlugin
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
dockerfile: docker/Dockerfile.linux.amd64
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: linux-amd64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerRegistry
|
||||||
|
identifier: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
tags:
|
||||||
|
- linux-amd64
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/Dockerfile.linux.amd64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: |
|
||||||
|
<+codebase.build.type> == "branch"
|
||||||
|
description: ""
|
||||||
|
- stage:
|
||||||
|
name: linux-arm64
|
||||||
|
identifier: linuxarm64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Arm64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
name: Build binaries
|
||||||
|
identifier: Build_binaries
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.20
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
# force go modules
|
||||||
|
export GOPATH=""
|
||||||
|
|
||||||
|
# disable cgo
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# linux
|
||||||
|
export GOOS=linux GOARCH=arm64
|
||||||
|
go build -v -a -tags netgo -o release/linux/arm64/drone-gitea-release .
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerPlugin
|
||||||
|
identifier: BuildAndPushDockerPlugin
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
dockerfile: docker/Dockerfile.linux.arm64
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: linux-arm64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerRegistry
|
||||||
|
identifier: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
tags:
|
||||||
|
- linux-arm64
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/Dockerfile.linux.arm64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: |
|
||||||
|
<+codebase.build.type> == "branch"
|
||||||
|
description: ""
|
||||||
|
- stage:
|
||||||
|
name: windows-1809-amd64
|
||||||
|
identifier: windows1809amd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
name: Build binaries
|
||||||
|
identifier: Build_binaries
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.20
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
# force go modules
|
||||||
|
export GOPATH=""
|
||||||
|
|
||||||
|
# disable cgo
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
GOOS=windows
|
||||||
|
go build -v -a -tags netgo -o release/windows/amd64/drone-gitea-release.exe .
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerPlugin
|
||||||
|
identifier: BuildAndPushDockerPlugin
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
dockerfile: docker/Dockerfile.windows.1809
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: windows-1809-amd64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerRegistry
|
||||||
|
identifier: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
tags:
|
||||||
|
- windows-1809-amd64
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/Dockerfile.windows.1809
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: |
|
||||||
|
<+codebase.build.type> == "branch"
|
||||||
|
infrastructure:
|
||||||
|
type: VM
|
||||||
|
spec:
|
||||||
|
type: Pool
|
||||||
|
spec:
|
||||||
|
poolName: windows-2019
|
||||||
|
os: Windows
|
||||||
|
description: ""
|
||||||
|
delegateSelectors:
|
||||||
|
- windows-vm
|
||||||
|
- stage:
|
||||||
|
name: windows-ltsc2022-amd64
|
||||||
|
identifier: windowsltsc2022amd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Windows
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
name: Build binaries
|
||||||
|
identifier: Build_binaries
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.20
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
# force go modules
|
||||||
|
export GOPATH=""
|
||||||
|
|
||||||
|
# disable cgo
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
GOOS=windows
|
||||||
|
go build -v -a -tags netgo -o release/windows/amd64/drone-gitea-release.exe .
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerPlugin
|
||||||
|
identifier: BuildAndPushDockerPlugin
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
dockerfile: docker/Dockerfile.windows.ltsc2022
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: windows-ltsc2022-amd64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerRegistry
|
||||||
|
identifier: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/gitea-release
|
||||||
|
tags:
|
||||||
|
- windows-ltsc2022-amd64
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/Dockerfile.windows.ltsc2022
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: |
|
||||||
|
<+codebase.build.type> == "branch"
|
||||||
|
description: ""
|
||||||
|
- stage:
|
||||||
|
name: Manifest
|
||||||
|
identifier: Manifest
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Manifest
|
||||||
|
identifier: Manifest
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
auto_tag: "true"
|
||||||
|
ignore_missing: "true"
|
||||||
|
spec: docker/manifest.tmpl
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: |
|
||||||
|
<+codebase.build.type> == "tag" || <+codebase.build.type> == "branch"
|
||||||
|
description: ""
|
||||||
|
allowStageExecutions: true
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
module github.com/drone-plugins/drone-gitea-release
|
module github.com/drone-plugins/drone-gitea-release
|
||||||
|
|
||||||
go 1.19
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.gitea.io/sdk/gitea v0.15.1
|
code.gitea.io/sdk/gitea v0.15.1
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
run:
|
|
||||||
go:
|
|
||||||
module: github.com/drone-plugins/drone-gitea-release
|
|
||||||
Reference in New Issue
Block a user