diff --git a/.drone.windows.yml b/.drone.windows.yml deleted file mode 100644 index a47d9bf..0000000 --- a/.drone.windows.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -kind: pipeline -name: windows-amd64 - -platform: - os: windows - arch: amd64 - -steps: -- name: build-push - pull: always - image: golang:1.17.3 - commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-s3" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-tag - pull: always - image: golang:1.17.3 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -o release/windows/amd64/drone-s3" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: executable - pull: always - image: golang:1.17.3 - commands: - - ./release/windows/amd64/drone-s3 --help - -- name: dryrun - pull: always - image: plugins/docker:windows-amd64 - settings: - dockerfile: docker/Dockerfile.windows.amd64 - dry_run: true - password: - from_secret: docker_password - repo: plugins/s3 - tags: windows-amd64 - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:windows-amd64 - settings: - auto_tag: true - auto_tag_suffix: windows-amd64 - dockerfile: docker/Dockerfile.windows.amd64 - password: - from_secret: docker_password - repo: plugins/s3 - username: - from_secret: docker_username - when: - event: - - push - - tag - -trigger: - branch: - - master diff --git a/.drone.yml b/.drone.yml index 58ed33b..3b4a0ca 100644 --- a/.drone.yml +++ b/.drone.yml @@ -267,6 +267,93 @@ trigger: depends_on: - testing +--- +kind: pipeline +type: ssh +name: windows-1809-amd64 + +platform: + os: windows + +server: + host: windows.1809.amd64.plugins.drone.ci + password: + from_secret: windows_password + user: + from_secret: windows_username + +steps: +- name: build + commands: + - go build -o release/windows/amd64/drone-s3.exe + - docker login -u $env:USERNAME -p $env:PASSWORD + - | + if (Test-Path env:DRONE_SEMVER_SHORT) { + docker build -f docker/Dockerfile.windows.1809 -t plugins/s3:$env:DRONE_SEMVER_SHORT-windows-1809-amd64 . + docker push plugins/s3:$env:DRONE_SEMVER_SHORT-windows-1809-amd64 + } else { + docker build -f docker/Dockerfile.windows.1809 -t plugins/s3:windows-1809-amd64 . + docker push plugins/s3:windows-1809-amd64 + } + environment: + CGO_ENABLED: "0" + USERNAME: + from_secret: docker_username + PASSWORD: + from_secret: docker_password + +trigger: + event: + - push + - tag + +depends_on: +- testing + +--- +kind: pipeline +type: ssh +name: windows-1903-amd64 + +platform: + os: windows + +server: + host: windows.1903.amd64.plugins.drone.ci + password: + from_secret: windows_password + user: + from_secret: windows_username + +steps: +- name: build + commands: + - echo $env:DRONE_SEMVER_SHORT + - go build -o release/windows/amd64/drone-s3.exe + - docker login -u $env:USERNAME -p $env:PASSWORD + - | + if (Test-Path env:DRONE_SEMVER_SHORT) { + docker build -f docker/Dockerfile.windows.1903 -t plugins/s3:$env:DRONE_SEMVER_SHORT-windows-1903-amd64 . + docker push plugins/s3:$env:DRONE_SEMVER_SHORT-windows-1903-amd64 + } else { + docker build -f docker/Dockerfile.windows.1903 -t plugins/s3:windows-1903-amd64 . + docker push plugins/s3:windows-1903-amd64 + } + environment: + CGO_ENABLED: "0" + USERNAME: + from_secret: docker_username + PASSWORD: + from_secret: docker_password + +trigger: + event: + - push + - tag + +depends_on: +- testing + --- kind: pipeline name: notifications @@ -305,5 +392,6 @@ depends_on: - linux-amd64 - linux-arm64 - linux-arm - +- windows-1809-amd64 +- windows-1903-amd64 ... diff --git a/docker/Dockerfile.windows.amd64 b/docker/Dockerfile.windows.1803 similarity index 52% rename from docker/Dockerfile.windows.amd64 rename to docker/Dockerfile.windows.1803 index 59229e7..c639def 100644 --- a/docker/Dockerfile.windows.amd64 +++ b/docker/Dockerfile.windows.1803 @@ -1,10 +1,13 @@ # escape=` -FROM plugins/base:windows-amd64 +FROM mcr.microsoft.com/windows/nanoserver:1803 +USER ContainerAdministrator + +ENV GODEBUG=netdns=go LABEL maintainer="Drone.IO Community " ` org.label-schema.name="Drone S3" ` org.label-schema.vendor="Drone.IO Community" ` org.label-schema.schema-version="1.0" -ADD release\drone-s3.exe c:\drone-s3.exe -ENTRYPOINT [ "c:\\drone-s3.exe" ] +ADD release/windows/amd64/drone-s3.exe C:/drone-s3.exe +ENTRYPOINT [ "C:\\drone-s3.exe" ] \ No newline at end of file diff --git a/docker/Dockerfile.windows.1809 b/docker/Dockerfile.windows.1809 new file mode 100644 index 0000000..2aaea9c --- /dev/null +++ b/docker/Dockerfile.windows.1809 @@ -0,0 +1,13 @@ +# escape=` +FROM mcr.microsoft.com/windows/nanoserver:1809 +USER ContainerAdministrator + +ENV GODEBUG=netdns=go + +LABEL maintainer="Drone.IO Community " ` + org.label-schema.name="Drone S3" ` + org.label-schema.vendor="Drone.IO Community" ` + org.label-schema.schema-version="1.0" + +ADD release/windows/amd64/drone-s3.exe C:/drone-s3.exe +ENTRYPOINT [ "C:\\drone-s3.exe" ] \ No newline at end of file diff --git a/docker/Dockerfile.windows.1903 b/docker/Dockerfile.windows.1903 new file mode 100644 index 0000000..4214de1 --- /dev/null +++ b/docker/Dockerfile.windows.1903 @@ -0,0 +1,13 @@ +# escape=` +FROM mcr.microsoft.com/windows/nanoserver:1903 +USER ContainerAdministrator + +ENV GODEBUG=netdns=go + +LABEL maintainer="Drone.IO Community " ` + org.label-schema.name="Drone S3" ` + org.label-schema.vendor="Drone.IO Community" ` + org.label-schema.schema-version="1.0" + +ADD release/windows/amd64/drone-s3.exe C:/drone-s3.exe +ENTRYPOINT [ "C:\\drone-s3.exe" ] \ No newline at end of file diff --git a/docker/Dockerfile.windows.1909 b/docker/Dockerfile.windows.1909 new file mode 100644 index 0000000..9ef475d --- /dev/null +++ b/docker/Dockerfile.windows.1909 @@ -0,0 +1,13 @@ +# escape=` +FROM mcr.microsoft.com/windows/nanoserver:1909 +USER ContainerAdministrator + +ENV GODEBUG=netdns=go + +LABEL maintainer="Drone.IO Community " ` + org.label-schema.name="Drone S3" ` + org.label-schema.vendor="Drone.IO Community" ` + org.label-schema.schema-version="1.0" + +ADD release/windows/amd64/drone-s3.exe C:/drone-s3.exe +ENTRYPOINT [ "C:\\drone-s3.exe" ] \ No newline at end of file diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl index 18de0c2..b792e33 100644 --- a/docker/manifest.tmpl +++ b/docker/manifest.tmpl @@ -24,8 +24,14 @@ manifests: os: linux variant: v7 - - image: plugins/s3:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-amd64 + image: plugins/s3:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64 platform: architecture: amd64 os: windows - variant: 1809 + version: 1809 + - + image: plugins/s3:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1903-amd64 + platform: + architecture: amd64 + os: windows + version: 1903 \ No newline at end of file