Skip to content

Commit

Permalink
Open source release
Browse files Browse the repository at this point in the history
  • Loading branch information
norbjd committed Jul 17, 2022
0 parents commit 9310ae8
Show file tree
Hide file tree
Showing 68 changed files with 7,249 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
pull_request:
push:
branches:
- main

env:
GO_VERSION: '^1.18.3'

jobs:
license-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: License check
run: |
make license_check
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Lint
run: |
make lint
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Tests + coverage
run: |
make coverage
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Build (all platforms)
run: |
make build_all_platforms
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: '^1.18.3'

- name: Build for all platforms
run: |
make build_all_platforms
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: pasuman-build-artifacts
path: pasuman-*

create_release:
runs-on: ubuntu-20.04

needs: build

outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}

upload_release_assets:
runs-on: ubuntu-20.04

needs: create_release

strategy:
matrix:
output: [linux-amd64, darwin-amd64, darwin-arm64]

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: pasuman-build-artifacts

- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.release_upload_url }}
asset_path: ./pasuman-${{ matrix.output }}
asset_name: pasuman-${{ matrix.output }}
asset_content_type: application/octet-stream
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage.out
pasuman*
!pasumantest/
32 changes: 32 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# unfortunately, go 1.18 does not support all linters for now,
# so we run the linter for go 1.17
# see https://github.com/golangci/golangci-lint/issues/2649
run:
go: '1.17'

linters:
enable-all: true
disable:
- cyclop
- exhaustruct
- exhaustivestruct
- forbidigo
- gochecknoglobals
- paralleltest
- testpackage
- varnamelen
- wrapcheck

linters-settings:
tagliatelle:
case:
use-field-name: true
rules:
json: snake

issues:
exclude-rules:
- path: _test\.go
linters:
- funlen

Loading

0 comments on commit 9310ae8

Please sign in to comment.