Use goc to build multiple versions at once, add openbsd/freebsd
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Tyler 2021-12-31 20:12:56 -05:00
parent 5901ca6d6c
commit e618577ad9
3 changed files with 50 additions and 16 deletions

View File

@ -1,33 +1,29 @@
kind: pipeline kind: pipeline
name: default name: default
type: docker
steps: steps:
- name: build - name: build
image: golang:latest image: tystuyfzand/goc:latest
group: build
volumes: volumes:
- name: build - name: build
path: /build path: /build
commands: commands:
- mkdir -p /build - mkdir -p /build
- GOOS=linux GOARCH=386 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_linux_i386 - go mod download
- GOOS=linux GOARCH=amd64 go build -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee_linux_amd64 - goc -ldflags="-X 'paste.ee/cli/cmd.Key=$API_KEY'" -o /build/pastee
- 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
environment: environment:
API_KEY: API_KEY:
from_secret: api_key from_secret: api_key
GOOS: linux,windows,darwin,openbsd,freebsd
GOARCH: 386,amd64,arm,arm64
- name: package - name: package
image: tystuyfzand/fpm image: tystuyfzand/fpm
commands: commands:
- chmod +x scripts/build-package.sh - 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=amd64 scripts/build-package.sh
- ARCH=armv7 scripts/build-package.sh - ARCH=arm scripts/build-package.sh
- ARCH=arm64 scripts/build-package.sh - ARCH=arm64 scripts/build-package.sh
volumes: volumes:
- name: build - name: build

30
README.md Normal file
View 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.

View File

@ -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 \ 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-priority optional --force \
--deb-compression gz --verbose \ --deb-compression gz --verbose \
--description "Paste.ee CLI Tool" \ --description "Paste.ee CLI Tool" \
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \ -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 \ 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 \ --description "Paste.ee CLI Tool" --verbose \
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \ -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