Release with GoReleaser. Allow start without key configuration (#788)
This commit is contained in:
@@ -50,9 +50,9 @@ jobs:
|
|||||||
args: build
|
args: build
|
||||||
|
|
||||||
- name: Static Check
|
- name: Static Check
|
||||||
uses: dominikh/staticcheck-action@v1.1.0
|
uses: dominikh/staticcheck-action@v1.2.0
|
||||||
with:
|
with:
|
||||||
version: "2021.1.1"
|
version: "2022.1"
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.17
|
go-version: 1.18
|
||||||
|
|
||||||
- name: Download Go modules
|
- name: Download Go modules
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
# only publish on version tags
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: macos-12
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Fetch all tags
|
||||||
|
run: git fetch --force --tags
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/go/pkg/mod
|
||||||
|
~/go/bin
|
||||||
|
~/.cache
|
||||||
|
key: livekit-server
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.18
|
||||||
|
|
||||||
|
- name: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v2
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
version: latest
|
||||||
|
args: release --rm-dist
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -25,3 +25,5 @@ proto/
|
|||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
dist/
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
- go generate ./...
|
||||||
|
builds:
|
||||||
|
# darwin build requires CGO, declaring it separately
|
||||||
|
- id: darwin
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=1
|
||||||
|
main: ./cmd/server
|
||||||
|
binary: livekit-server
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
goos:
|
||||||
|
- darwin
|
||||||
|
- id: livekit
|
||||||
|
env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
main: ./cmd/server
|
||||||
|
binary: livekit-server
|
||||||
|
goarm:
|
||||||
|
- "7"
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
- arm
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
archives:
|
||||||
|
- format_overrides:
|
||||||
|
- goos: windows
|
||||||
|
format: zip
|
||||||
|
replacements:
|
||||||
|
darwin: mac
|
||||||
|
files:
|
||||||
|
- LICENSE
|
||||||
|
nfpms:
|
||||||
|
- package_name: livekit
|
||||||
|
vendor: LiveKit
|
||||||
|
homepage: https://livekit.io
|
||||||
|
description: |-
|
||||||
|
LiveKit is a high-performance WebRTC server. It provides software components for building multi-user, real-time, media applications.
|
||||||
|
license: Apache 2.0
|
||||||
|
|
||||||
|
formats:
|
||||||
|
- deb
|
||||||
|
- rpm
|
||||||
|
|
||||||
|
recommends:
|
||||||
|
- redis-server
|
||||||
|
release:
|
||||||
|
github:
|
||||||
|
owner: livekit
|
||||||
|
name: livekit
|
||||||
|
draft: true
|
||||||
|
prerelease: auto
|
||||||
|
changelog:
|
||||||
|
sort: asc
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- '^docs:'
|
||||||
|
- '^test:'
|
||||||
|
gomod:
|
||||||
|
proxy: true
|
||||||
|
mod: mod
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ incpatch .Version }}-next"
|
||||||
|
|
||||||
+27
-5
@@ -13,10 +13,10 @@ import (
|
|||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
|
serverlogger "github.com/livekit/livekit-server/pkg/logger"
|
||||||
"github.com/livekit/protocol/logger"
|
"github.com/livekit/protocol/logger"
|
||||||
|
|
||||||
"github.com/livekit/livekit-server/pkg/config"
|
"github.com/livekit/livekit-server/pkg/config"
|
||||||
serverlogger "github.com/livekit/livekit-server/pkg/logger"
|
|
||||||
"github.com/livekit/livekit-server/pkg/routing"
|
"github.com/livekit/livekit-server/pkg/routing"
|
||||||
"github.com/livekit/livekit-server/pkg/service"
|
"github.com/livekit/livekit-server/pkg/service"
|
||||||
"github.com/livekit/livekit-server/version"
|
"github.com/livekit/livekit-server/version"
|
||||||
@@ -92,7 +92,7 @@ func main() {
|
|||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "dev",
|
Name: "dev",
|
||||||
Usage: "sets log-level to debug, console formatter, and /debug/pprof",
|
Usage: "sets log-level to debug, console formatter, and /debug/pprof. insecure for production.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: startServer,
|
Action: startServer,
|
||||||
@@ -149,7 +149,31 @@ func getConfig(c *cli.Context) (*config.Config, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return config.NewConfig(confString, c)
|
conf, err := config.NewConfig(confString, c)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
serverlogger.InitFromConfig(conf.Logging)
|
||||||
|
|
||||||
|
if c.String("config") == "" && c.String("config-body") == "" {
|
||||||
|
// without config, use single port UDP
|
||||||
|
conf.Development = true
|
||||||
|
conf.RTC.UDPPort = 7882
|
||||||
|
conf.RTC.ICEPortRangeStart = 0
|
||||||
|
conf.RTC.ICEPortRangeEnd = 0
|
||||||
|
logger.Infow("starting in development mode")
|
||||||
|
|
||||||
|
if len(conf.Keys) == 0 {
|
||||||
|
logger.Infow("no keys provided, using placeholder keys",
|
||||||
|
"API Key", "devkey",
|
||||||
|
"API Secret", "secret",
|
||||||
|
)
|
||||||
|
conf.Keys = map[string]string{
|
||||||
|
"devkey": "secret",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return conf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func startServer(c *cli.Context) error {
|
func startServer(c *cli.Context) error {
|
||||||
@@ -162,8 +186,6 @@ func startServer(c *cli.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
serverlogger.InitFromConfig(conf.Logging)
|
|
||||||
|
|
||||||
if memProfile != "" {
|
if memProfile != "" {
|
||||||
if f, err := os.Create(memProfile); err != nil {
|
if f, err := os.Create(memProfile); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -214,9 +214,7 @@ func (s *StreamTracker) BitrateTemporalCumulative() []int64 {
|
|||||||
|
|
||||||
// copy and process
|
// copy and process
|
||||||
brs := make([]int64, len(s.bitrate))
|
brs := make([]int64, len(s.bitrate))
|
||||||
for i := 0; i < len(s.bitrate); i++ {
|
copy(brs, s.bitrate[:])
|
||||||
brs[i] = s.bitrate[i]
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := len(brs) - 1; i >= 1; i-- {
|
for i := len(brs) - 1; i >= 1; i-- {
|
||||||
if brs[i] != 0 {
|
if brs[i] != 0 {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build !linux
|
//go:build !linux
|
||||||
// +build !linux
|
|
||||||
|
|
||||||
package prometheus
|
package prometheus
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user