Skip to content

Commit

Permalink
Add GoReleaser configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mxpv committed Nov 14, 2019
1 parent 0767f97 commit b66cf76
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 34 deletions.
53 changes: 53 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
project_name: "Podsync"

before:
hooks:
- go mod tidy

builds:
- main: ./cmd/podsync/
binary: podsync
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64

dockers:
- image_templates:
- 'mxpv/podsync:{{ .Tag }}'
- 'mxpv/podsync:v{{ .Major }}.{{ .Minor }}'
- 'mxpv/podsync:latest'
- 'docker.pkg.github.com/mxpv/podsync/cli:{{ .Tag }}'
- 'docker.pkg.github.com/mxpv/podsync/cli:v{{ .Major }}.{{ .Minor }}'
- 'docker.pkg.github.com/mxpv/podsync/cli:latest'
binaries:
- podsync
dockerfile: Dockerfile

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
FROM golang:1.12 as build
WORKDIR /work
COPY . .
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 make build

FROM alpine:3.10
RUN apk --no-cache add \
ca-certificates \
youtube-dl \
ffmpeg
WORKDIR /app/
COPY --from=build /work/podsync /app/podsync
COPY podsync /app/podsync
ENTRYPOINT ["/app/podsync"]
39 changes: 11 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,14 @@ Podsync - is a simple, free service that lets you listen to any YouTube / Vimeo

Podcast applications have a rich functionality for content delivery - automatic download of new episodes, remembering last played position, sync between devices and offline listening. This functionality is not available on YouTube and Vimeo. So the aim of Podsync is to make your life easier and enable you to view/listen to content on any device in podcast client.

## Architecture

![Architecture](docs/img/architecture.png)

## Building Docker images

Every project contains a `Makefile` for building and pushing to a registry:

```bash
make build
make push
make update
```

Use docker-compose to run containers:

```bash
docker-compose pull
docker-compose up -d
```

## Building frontend
Node.js and npm are required in order to build the frontend:
```bash
brew install node
make static
ls -la dist/
```
## How to release

- Add and push version tag
```
$ git tag -a v0.1.0 -m "First release"
$ git push origin v0.1.0
```
- Run GoReleaser at the root of your repository:
```
$ goreleaser --rm-dist
```
12 changes: 12 additions & 0 deletions cmd/podsync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ const banner = `
|/ (_______)(______/ \_______) \_/ |/ )_)(_______/
`

var (
version = "dev"
commit = "none"
date = "unknown"
)

func main() {
log.SetFormatter(&log.TextFormatter{
TimestampFormat: time.RFC3339,
Expand Down Expand Up @@ -61,6 +67,12 @@ func main() {
log.Info(banner)
}

log.WithFields(log.Fields{
"version": version,
"commit": commit,
"date": date,
}).Info("running podsync")

// Load TOML file
log.Debugf("loading configuration %q", opts.ConfigPath)
cfg, err := config.LoadConfig(opts.ConfigPath)
Expand Down

0 comments on commit b66cf76

Please sign in to comment.