Parse user agent into a human-friendly string on submission #79
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: Linting, build, test and release | |
# Runs on each PR to lint and test | |
# Runs on each release (via github UI) to lint and test, then upload binary to the release | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# do a full clone; we need to also get the branch master, required to allow towncrier to diff properly. | |
- uses: actions/setup-python@v3 | |
- name: Install towncrier | |
run: pip install 'towncrier>19.2' | |
- name: Run towncrier | |
run: python -m towncrier.check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.16 | |
- name: Install lint deps | |
run: | | |
go get golang.org/x/lint/golint | |
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow | |
go get github.com/fzipp/gocyclo/cmd/gocyclo | |
- name: lint | |
run: ./scripts/lint.sh | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
golang: ["1.17", "1.16"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "${{ matrix.golang }}" | |
- name: Build | |
run: go build | |
- name: Test | |
run: go test | |
- name: Create tarball for release | |
if: github.event.release | |
run: tar -czf rageshake.tar.gz rageshake | |
- name: Upload tarball to matching release | |
if: github.event.release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
files: rageshake.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |