Add publish pipeline
continuous-integration/drone/push Build is failing Details

This commit is contained in:
IamTheFij 2021-01-08 16:45:30 -05:00
parent fc3e8a356b
commit da8ff84fd3
3 changed files with 67 additions and 0 deletions

View File

@ -6,12 +6,63 @@ steps:
- name: check
image: iamthefij/drone-pre-commit:personal
---
kind: pipeline
name: publish
depends_on:
- test
trigger:
event:
- push
- tag
refs:
- refs/heads/master
- refs/tags/v*
steps:
- name: submodules
image: alpine/git
commands:
- git submodule init
- git submodule update --recursive --remote
- name: build
image: golang:1.15
commands:
- apt-get update
- apt-get install -y --no-install-recommends libpcsclite-dev
# Download and install mage
- (cd $GOPATH && go get -u -d github.com/magefile/mage)
- (cd $GOPATH/src/github.com/magefile/mage && go run bootstrap.go)
# Build distribution bundle
- ./mage_fake_env.sh dist
- name: gitea release
image: plugins/gitea-release
settings:
title: ${DRONE_TAG}
files: dist/*
checksum:
- md5
- sha1
- sha256
- sha512
base_url:
from_secret: gitea_base_url
api_key:
from_secret: gitea_token
when:
event: tag
---
kind: pipeline
name: notify
depends_on:
- test
- publish
trigger:
status:

2
.gitignore vendored
View File

@ -74,3 +74,5 @@ src/vendor/
src/libusb-1.0.dylib
*.pyc
venv
static-builder
fake_alfred_home/

14
mage_fake_env.sh Executable file
View File

@ -0,0 +1,14 @@
#! /bin/bash
# Statically compile the builder
mage -compile ./static-builder
# Change the environment to one that looks kinda like Alfred
export HOME=fake_alfred_home
alfred_sync_dir="$HOME/Library/Application Support/Alfred"
mkdir -p "$alfred_sync_dir/Alfred.alfredpreferences/workflows"
echo '{"syncfolders": {"4": "/dev/null"}, "current": "/dev/null"}' > "$alfred_sync_dir/prefs.json"
# Run the builder with whatever arguments
export GOOS=darwin
export GOARCH=amd64
./static-builder "$@"