8 Commits

Author SHA1 Message Date
e67fb8275c Trying to appease drone
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 12:08:25 -05:00
c9ca320b87 Add ENV to build stage
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 12:05:17 -05:00
08c2417014 Testing drone
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 12:03:43 -05:00
0519f8e8cb Declare env step
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 12:02:45 -05:00
3c040e5352 Didn't like that
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 11:58:27 -05:00
2083ad48f5 Update drone environment
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 11:51:54 -05:00
14d163c058 Add API key for drone automated builds
Some checks failed
continuous-integration/drone/push Build is failing
2022-02-22 11:08:08 -05:00
852beb656c Update Drone for other platforms
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-02-22 09:56:32 -05:00
2 changed files with 17 additions and 3 deletions

View File

@ -5,17 +5,26 @@ name: default
steps: steps:
- name: Build - name: Build
image: golang image: golang
environment:
NASA_TOKEN:
from_secret: nasa_api
commands: commands:
- go get github.com/reujab/wallpaper - go get github.com/reujab/wallpaper
- go vet -v - go vet -v
- go build - env
- GOOS="linux" go build -ldflags="-w -s -x main.api_key=$NASA_TOKEN" -o SpaceFace-Linux
- GOOS="windows" go build -ldflags="-w -s -x main.api_key=$NASA_TOKEN" -o SpaceFace-Win.exe
- GOOS="darwin" go build -ldflags="-w -s -x main.api_key=$NASA_TOKEN" -o SpaceFace-macOS
- name: gitea_release - name: gitea_release
image: plugins/gitea-release image: plugins/gitea-release
settings: settings:
base_url: https://git.nightmare.haus base_url: https://git.nightmare.haus
api_key: api_key:
from_secret: gitea_token from_secret: gitea_token
files: ./SpaceFace files:
- ./SpaceFace-Linux
- ./SpaceFace-Win.exe
- ./SpaceFace-macOS
checksum: checksum:
- md5 - md5
- sha1 - sha1

View File

@ -2,6 +2,7 @@ package main
import ( import (
"encoding/json" "encoding/json"
"fmt"
"io" "io"
"log" "log"
"net/http" "net/http"
@ -12,10 +13,14 @@ import (
var ( var (
apod APODResponse apod APODResponse
api_key string
) )
func main() { func main() {
resp, err := http.Get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY") if len(api_key) == 0 {
api_key="DEMO_KEY"
}
resp, err := http.Get(fmt.Sprintf("https://api.nasa.gov/planetary/apod?api_key=%+v", api_key))
if err != nil { if err != nil {
log.Fatalf("\nUnable to get NASA API Response\n") log.Fatalf("\nUnable to get NASA API Response\n")
return return