mirror of
https://github.com/ivuorinen/actions.git
synced 2026-03-02 08:53:49 +00:00
feat: add GitHub Actions workflows for code quality and automation (#2)
This commit is contained in:
36
go-build/README.md
Normal file
36
go-build/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# ivuorinen/actions/go-build
|
||||
|
||||
## Go Build
|
||||
|
||||
### Description
|
||||
|
||||
Builds the Go project.
|
||||
|
||||
### Inputs
|
||||
|
||||
| name | description | required | default |
|
||||
| ------------- | ----------------------------------- | -------- | ------- |
|
||||
| `go-version` | <p>Go version to use.</p> | `false` | `""` |
|
||||
| `destination` | <p>Build destination directory.</p> | `false` | `./bin` |
|
||||
|
||||
### Runs
|
||||
|
||||
This action is a `composite` action.
|
||||
|
||||
### Usage
|
||||
|
||||
```yaml
|
||||
- uses: ivuorinen/actions/go-build@main
|
||||
with:
|
||||
go-version:
|
||||
# Go version to use.
|
||||
#
|
||||
# Required: false
|
||||
# Default: ""
|
||||
|
||||
destination:
|
||||
# Build destination directory.
|
||||
#
|
||||
# Required: false
|
||||
# Default: ./bin
|
||||
```
|
||||
34
go-build/action.yml
Normal file
34
go-build/action.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
|
||||
name: Go Build
|
||||
description: 'Builds the Go project.'
|
||||
author: 'Ismo Vuorinen'
|
||||
|
||||
branding:
|
||||
icon: package
|
||||
color: blue
|
||||
|
||||
inputs:
|
||||
go-version:
|
||||
description: 'Go version to use.'
|
||||
required: false
|
||||
destination:
|
||||
description: 'Build destination directory.'
|
||||
required: false
|
||||
default: './bin'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Detect Go Version
|
||||
uses: ivuorinen/actions/go-version-detect@main
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '${{ steps.detect-go-version.outputs.go-version }}'
|
||||
|
||||
- name: Build Go Project
|
||||
shell: bash
|
||||
run: |
|
||||
go build -o ${{ inputs.destination }} ./...
|
||||
Reference in New Issue
Block a user