diff --git a/.drone.yml b/.drone.yml index a330516..804d9a3 100644 --- a/.drone.yml +++ b/.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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..32462e0 --- /dev/null +++ b/README.md @@ -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. \ No newline at end of file diff --git a/scripts/build-package.sh b/scripts/build-package.sh index 2258fa8..fe8a5b6 100644 --- a/scripts/build-package.sh +++ b/scripts/build-package.sh @@ -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 " --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 " --vendor "Paste.ee" \ - -a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee \ No newline at end of file + /build/pastee_linux_${ARCH}=/usr/bin/pastee \ No newline at end of file