# README
Create an Action using Golang
Use this template to bootstrap the creation of a Golang action.:rocket:
This template includes compiliation support, tests, a validation workflow, publishing, and versioning guidance.
Create an action from this template
Click the Use this Template
and provide the new repo details for your action
Code in Master
Install the dependencies
$ go mod download
Build the code
$ go build
Run the tests :heavy_check_mark:
$ go test -v ./...
=== RUN TestRunMain
--- PASS: TestRunMain (0.01s)
PASS
ok github.com/actions-go/go-action 0.315s
...
Commit the pre-built binaries to ./dist/main_linux
, ./dist/main_darwin
and ./dist/main_windows.exe
for respectively linux, mac OS and windows actions.
Change action.yml
The action.yml contains defines the inputs and output for your action.
Update the action.yml with your name, description, inputs and outputs for your action.
See the documentation
Publish to a distribution branch
Actions are run from GitHub repos. We will create a releases branch and only checkin production modules (core in this case).
$ git checkout -b releases/v1
$ git commit -a -m "prod dependencies"
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1
Your action is now published! :rocket:
See the versioning documentation
Usage:
After testing you can create a v1 tag to reference the stable and tested action
uses: actions-go/go-action@master
with:
milliseconds: 1000