Skip to content

Commit

Permalink
add ci (#3227)
Browse files Browse the repository at this point in the history
* add ci

Co-authored-by: xianhuawei <xianhuawei@macair2018.local>
Co-authored-by: Raullen Chai <raullenchai@gmail.com>
  • Loading branch information
3 people committed Mar 29, 2022
1 parent f85c9ad commit 015527d
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
# What's Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: 'Breaking'
label: 'type: breaking'
- title: 'New'
label: 'type: feature'
- title: 'Bug Fixes'
label: 'type: bug'
- title: 'Maintenance'
label: 'type: maintenance'
- title: 'Documentation'
label: 'type: docs'
- title: 'Other changes'
- title: 'Dependency Updates'
label: 'type: dependencies'
collapse-after: 5

version-resolver:
major:
labels:
- 'type: breaking'
minor:
labels:
- 'type: feature'
patch:
labels:
- 'type: bug'
- 'type: maintenance'
- 'type: docs'
- 'type: dependencies'
- 'type: security'

exclude-labels:
- 'skip-changelog'
42 changes: 42 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci

on:

pull_request:
branches: [ master ]
#types: [opened]

permissions:
contents: read
pull-requests: read
packages: write

env:
GO111MODULE: on

jobs:
ci:
name: ci flow
runs-on: self-hosted
steps:

- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: errcheck
uses: reviewdog/action-golangci-lint@v2
with:
golangci_lint_flags: "--disable-all -E errcheck"
tool_name: errcheck
level: info

- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: '-no-fail -fmt sarif -out results.sarif ./...'


File renamed without changes.
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: ioctl-linux-amd64
asset_name: ioctl-linux-amd64
- os: windows-latest
artifact_name: ioctl-windows-amd64.exe
asset_name: ioctl-windows-amd64.exe
- os: macos-latest
artifact_name: ioctl-darwin-amd64
asset_name: ioctl-darwin-amd64
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: make ioctl
run: |
set CGO_ENABLED=1
set GOARCH=amd64
go build -tags netgo -o ./${{ matrix.artifact_name }} -v ./tools/ioctl
# - uses: release-drafter/release-drafter@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

0 comments on commit 015527d

Please sign in to comment.