4 Commits

Author SHA1 Message Date
5901ca6d6c Resolve issue with debian package building, use $HOME/.config/pastee as config path 2021-03-27 18:15:26 -04:00
9c0c218f46 Correct package names 2021-03-27 01:28:55 -04:00
f7a98af9b6 Correct package names 2021-03-27 01:28:06 -04:00
92bd09a2c6 Add rpm and deb builds 2021-03-27 00:54:08 -04:00
3 changed files with 30 additions and 2 deletions

View File

@ -21,6 +21,19 @@ steps:
environment: environment:
API_KEY: API_KEY:
from_secret: api_key from_secret: api_key
- name: package
image: tystuyfzand/fpm
commands:
- chmod +x scripts/build-package.sh
- ARCH=i386 scripts/build-package.sh
- ARCH=amd64 scripts/build-package.sh
- ARCH=armv7 scripts/build-package.sh
- ARCH=arm64 scripts/build-package.sh
volumes:
- name: build
path: /build
when:
event: tag
- name: release - name: release
image: plugins/gitea-release image: plugins/gitea-release
volumes: volumes:

View File

@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"os" "os"
"path"
) )
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
@ -48,9 +49,10 @@ func initConfig() {
home, err := homedir.Dir() home, err := homedir.Dir()
cobra.CheckErr(err) cobra.CheckErr(err)
viper.SetConfigName(".pastee") viper.SetConfigName("pastee")
viper.SetConfigType("yaml") viper.SetConfigType("yaml")
viper.AddConfigPath(home) viper.AddConfigPath(path.Join(home, ".config", "pastee"))
viper.AddConfigPath("/etc")
if err := viper.ReadInConfig(); err != nil { if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok { if _, ok := err.(viper.ConfigFileNotFoundError); ok {

13
scripts/build-package.sh Normal file
View File

@ -0,0 +1,13 @@
fpm -s dir -t deb -p /build/pastee_${DRONE_TAG}_${ARCH}.deb \
-n pastee -v $DRONE_SEMVER -a $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
fpm -s dir -t rpm -p /build/pastee_${DRONE_TAG}_${ARCH}.rpm \
-n pastee -v $DRONE_SEMVER -a $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