Skip to content

Commit

Permalink
Release binary assets with compression (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham149 authored Mar 22, 2023
1 parent bb02f5f commit 4499ffe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
35 changes: 24 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,28 +488,41 @@ depends_on:

---
kind: pipeline
type: docker
type: vm
name: release artifacts

pool:
use: ubuntu

steps:
- name: build
image: golang:1.19
commands:
- GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/plugin-linux-amd64
- GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/plugin-linux-arm64
- GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/plugin-darwin-amd64
- GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/plugin-darwin-arm64
- GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=${DRONE_TAG##v}" -o release/plugin-windows-amd64.exe
- GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/plugin-linux-amd64
- GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/plugin-linux-arm64
- GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/plugin-darwin-amd64
- GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/plugin-darwin-arm64
- GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/plugin-windows-amd64.exe

- name: zstd-compress
commands:
- sudo apt-get update -y
- sudo apt-get install -y zstd
- zstd release/plugin-linux-amd64
- zstd release/plugin-linux-arm64
- zstd release/plugin-darwin-arm64
- zstd release/plugin-darwin-amd64
- zstd release/plugin-windows-amd64.exe

- name: release
image: plugins/github-release
settings:
files:
- release/plugin-linux-amd64
- release/plugin-linux-arm64
- release/plugin-darwin-amd64
- release/plugin-darwin-arm64
- release/plugin-windows-amd64.exe
- release/plugin-linux-amd64.zst
- release/plugin-linux-arm64.zst
- release/plugin-darwin-amd64.zst
- release/plugin-darwin-arm64.zst
- release/plugin-windows-amd64.exe.zst
api_key:
from_secret: github_token
trigger:
Expand Down
4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
run:
go:
module: github.com/meltwater/drone-cache
binary:
source: https://github.com/drone-plugins/drone-meltwater-cache/releases/download/{{ release }}/drone-s3-{{ os }}-{{ arch }}.zst

0 comments on commit 4499ffe

Please sign in to comment.