Skip to content

Patches

Patches #88

Workflow file for this run

name: Go CI
on:
push:
branches: [ main ]
tags: [ v*.*.* ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Initialize Git submodules
run: |
git submodule init
git submodule update
- name: Install dependencies
run: make deps
- name: Run go fmt
run: make fmt
- name: Run go vet
run: make vet
- name: Run staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
- name: Run tests
run: make test
- name: Build binaries
run: make build
- name: Create tarball
run: tar -czvf das-${{ matrix.os }}.tar.gz bin
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: das-${{ matrix.os }}
path: das-${{ matrix.os }}.tar.gz
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: das-ubuntu-latest
path: .
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: das-macos-latest
path: .
- name: Upload release asset
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false
files: |
das-ubuntu-latest.tar.gz
das-macos-latest.tar.gz