Tvdbmap #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.7" | |
cache: true | |
- name: Test | |
run: go test -v ./... | |
goreleaserbuild: | |
name: Build Go binaries | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.7" | |
cache: true | |
- name: Run GoReleaser build | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean --skip-validate --skip-publish --parallelism 99 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload assets | |
uses: actions/upload-artifact@v3 | |
with: | |
name: shinkrodb | |
path: | | |
dist/*.tar.gz | |
dist/*.zip | |
goreleaser: | |
name: Build and publish binaries | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20.7" | |
cache: true | |
- name: Run GoReleaser build and publish tags | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload assets | |
uses: actions/upload-artifact@v3 | |
with: | |
name: shinkrodb | |
path: | | |
dist/*.tar.gz | |
dist/*.zip |