Use goc to build multiple versions at once, add openbsd/freebsd
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
5901ca6d6c
commit
e618577ad9
20
.drone.yml
20
.drone.yml
@ -1,33 +1,29 @@
|
||||
kind: pipeline
|
||||
name: default
|
||||
type: docker
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:latest
|
||||
group: build
|
||||
image: tystuyfzand/goc:latest
|
||||
volumes:
|
||||
- name: build
|
||||
path: /build
|
||||
commands:
|
||||
- mkdir -p /build
|
||||
- GOOS=linux GOARCH=386 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_linux_i386
|
||||
- GOOS=linux GOARCH=amd64 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_linux_amd64
|
||||
- GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_linux_armv7
|
||||
- GOOS=linux GOARCH=arm64 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_linux_arm64
|
||||
- GOOS=windows GOARCH=386 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_windows_i386.exe
|
||||
- GOOS=windows GOARCH=amd64 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_windows_amd64.exe
|
||||
- GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_macos_arm64
|
||||
- GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_macos_amd64
|
||||
- go mod download
|
||||
- goc -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee
|
||||
environment:
|
||||
API_KEY:
|
||||
from_secret: api_key
|
||||
GOOS: linux,windows,darwin,openbsd,freebsd
|
||||
GOARCH: 386,amd64,arm,arm64
|
||||
- name: package
|
||||
image: tystuyfzand/fpm
|
||||
commands:
|
||||
- chmod +x scripts/build-package.sh
|
||||
- ARCH=i386 scripts/build-package.sh
|
||||
- ARCH=386 scripts/build-package.sh
|
||||
- ARCH=amd64 scripts/build-package.sh
|
||||
- ARCH=armv7 scripts/build-package.sh
|
||||
- ARCH=arm scripts/build-package.sh
|
||||
- ARCH=arm64 scripts/build-package.sh
|
||||
volumes:
|
||||
- name: build
|
||||
|
30
README.md
Normal file
30
README.md
Normal file
@ -0,0 +1,30 @@
|
||||
Paste.ee CLI
|
||||
============
|
||||
|
||||
[![Build Status](https://drone.meow.tf/api/badges/paste-ee/cli/status.svg)](https://drone.meow.tf/paste-ee/cli)
|
||||
|
||||
A simple, flexible CLI tool for uploading to Paste.ee.
|
||||
|
||||
Uploading Pastes
|
||||
----------------
|
||||
|
||||
The CLI supports two methods of uploading, stdin and file arguments.
|
||||
|
||||
stdin:
|
||||
|
||||
```shell
|
||||
echo hello | pastee
|
||||
```
|
||||
|
||||
files:
|
||||
|
||||
```shell
|
||||
pastee FILE1 FILE2 FILE3
|
||||
```
|
||||
|
||||
Pastes can be encrypted by passing `-e` or `--encrypt` to the tool, which will encrypt on your server and upload just like the web interface.
|
||||
|
||||
Logging in
|
||||
----------
|
||||
|
||||
If you'd like to attach your pastes to an account, you can login via `pastee login`. This will authenticate your account against the API and store an API key to upload with.
|
@ -1,13 +1,21 @@
|
||||
PACKAGE_ARCH="$ARCH"
|
||||
|
||||
if [ "$PACKAGE_ARCH" = "arm" ]; then
|
||||
PACKAGE_ARCH="armhf"
|
||||
elif [ "$PACKAGE_ARCH" = "386" ]; then
|
||||
PACKAGE_ARCH="i386"
|
||||
fi
|
||||
|
||||
fpm -s dir -t deb -p /build/pastee_${DRONE_TAG}_${ARCH}.deb \
|
||||
-n pastee -v $DRONE_SEMVER -a $ARCH \
|
||||
-n pastee -v $DRONE_SEMVER -a $PACKAGE_ARCH \
|
||||
--deb-priority optional --force \
|
||||
--deb-compression gz --verbose \
|
||||
--description "Paste.ee CLI Tool" \
|
||||
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
|
||||
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
|
||||
/build/pastee_linux_${ARCH}=/usr/bin/pastee
|
||||
|
||||
fpm -s dir -t rpm -p /build/pastee_${DRONE_TAG}_${ARCH}.rpm \
|
||||
-n pastee -v $DRONE_SEMVER -a $ARCH \
|
||||
-n pastee -v $DRONE_SEMVER -a $PACKAGE_ARCH \
|
||||
--description "Paste.ee CLI Tool" --verbose \
|
||||
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
|
||||
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
|
||||
/build/pastee_linux_${ARCH}=/usr/bin/pastee
|
Loading…
Reference in New Issue
Block a user