introduce release pipeline with taskfile and goreleaser

This commit is contained in:
Florian Baumann 2022-10-20 16:00:46 +02:00
parent 2a2a6b1f72
commit e6fb8967ea
11 changed files with 25 additions and 5 deletions

View File

@ -11,12 +11,14 @@ builds:
- CGO_ENABLED=0 - CGO_ENABLED=0
goos: goos:
- linux - linux
- windows
- darwin - darwin
- openbsd - openbsd
archives: archives:
- replacements: - replacements:
darwin: Darwin darwin: Darwin
linux: Linux linux: Linux
windows: Windows
openbsd: OpenBSD openbsd: OpenBSD
386: i386 386: i386
amd64: x86_64 amd64: x86_64
@ -73,7 +75,7 @@ brews:
# Your app's description. # Your app's description.
# Default is empty. # Default is empty.
description: "serra - I wrote a typing trainer to get into my ortholinear keyboard" description: "serra - Personal Magic: The Gathering Collection Tracker "
# SPDX identifier of your app's license. # SPDX identifier of your app's license.
# Default is empty. # Default is empty.

View File

@ -12,6 +12,14 @@ tasks:
generates: generates:
- "./serra" - "./serra"
release:
interactive: true
cmds:
- git tag | tail -5
- read -p "Version v1.1.1 " version ; git tag $version
- git push --tags
- goreleaser release --rm-dist
default: default:
cmds: cmds:
- task: build - task: build

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 104 KiB

BIN
imgs/flops.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 217 KiB

BIN
imgs/update.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@ -88,16 +88,24 @@ Calculate some stats for all of your cards
## Tops ## Tops
Show what cards/se gained most value Show what cards/set gained most value
![](https://github.com/noqqe/serra/blob/main/imgs/tops.png) ![](https://github.com/noqqe/serra/blob/main/imgs/tops.png)
## Flops
Show what cards/set lost most value
![](https://github.com/noqqe/serra/blob/main/imgs/flops.png)
## Update ## Update
The update mechanism iterates over each card in your collection and fetches The update mechanism iterates over each card in your collection and fetches
its price. After all cards you own in a set are updated, the set value will its price. After all cards you own in a set are updated, the set value will
update. After all Sets are updated, the whole collection value is updated. update. After all Sets are updated, the whole collection value is updated.
![](https://github.com/noqqe/serra/blob/main/imgs/update.png)
## Adding all those cards, manually? ## Adding all those cards, manually?
Yes. While there are serveral OCR/Photo Scanners for mtg cards, I found they Yes. While there are serveral OCR/Photo Scanners for mtg cards, I found they
@ -121,12 +129,14 @@ read> 18
Its basically typing 2-3 digit numbers and hitting enter. I was way faster Its basically typing 2-3 digit numbers and hitting enter. I was way faster
with this approach then Smartphone scanners. with this approach then Smartphone scanners.
# Install # Development
## Install
go build . go build .
./serra ./serra
# Cheatsheet Queries ## Cheatsheet Queries
Find cards that increased prices Find cards that increased prices
@ -155,7 +165,7 @@ Calculate what cards gained most value in percent
db.cards.aggregate({$project: {set: 1, collectornumber:1, name: 1, "old": {$arrayElemAt: ["$serra_prices.value", -2]}, "current": {$arrayElemAt: ["$serra_prices.value", -1]} }}, {$match: {old: {$gt: 2}}} ,{$project: {name: 1,set:1,collectornumber:1,current:1, "rate": {$subtract: [{$divide: ["$current", {$divide: ["$old", 100]}]}, 100]} }}, {$sort: { rate: -1}}) db.cards.aggregate({$project: {set: 1, collectornumber:1, name: 1, "old": {$arrayElemAt: ["$serra_prices.value", -2]}, "current": {$arrayElemAt: ["$serra_prices.value", -1]} }}, {$match: {old: {$gt: 2}}} ,{$project: {name: 1,set:1,collectornumber:1,current:1, "rate": {$subtract: [{$divide: ["$current", {$divide: ["$old", 100]}]}, 100]} }}, {$sort: { rate: -1}})
# MongoDB Operations ## MongoDB Operations
A few commands that do backups and exports of your data inside of the docker A few commands that do backups and exports of your data inside of the docker
container. container.