2021-01-09 18:18:31 -05:00
|
|
|
name: 'CI'
|
|
|
|
on:
|
|
|
|
push:
|
2021-12-14 01:18:47 -05:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2021-01-09 18:18:31 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
goreleaser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-12-14 23:37:02 -05:00
|
|
|
- name: Checkout
|
2021-01-09 18:18:31 -05:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: Install libopus-dev
|
2021-12-14 00:59:51 -05:00
|
|
|
run: sudo apt update && sudo apt-get -y install libopus-dev
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: Set up Go
|
2021-01-09 18:18:31 -05:00
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-12-12 23:54:32 -05:00
|
|
|
go-version: 1.17
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: go-license install
|
2021-12-14 00:59:51 -05:00
|
|
|
run: go install github.com/google/go-licenses@latest
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: go-license save
|
2021-12-12 23:54:32 -05:00
|
|
|
run: go-licenses save ./cmd/mumble-discord-bridge --force --save_path="./dist/LICENSES"
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: Log in to Docker Hub
|
|
|
|
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
2021-12-14 01:18:47 -05:00
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
2021-12-14 23:37:02 -05:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Run GoReleaser Build
|
|
|
|
uses: goreleaser/goreleaser-action@v2
|
2021-12-14 01:18:47 -05:00
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: build --rm-dist
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: Run GoReleaser Release
|
2021-01-09 18:18:31 -05:00
|
|
|
uses: goreleaser/goreleaser-action@v2
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist
|
|
|
|
env:
|
2021-12-12 23:54:32 -05:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-12-14 23:37:02 -05:00
|
|
|
|
|
|
|
- name: Upload assets
|
2021-12-14 01:18:47 -05:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: mdb
|
|
|
|
path: dist/*
|