Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/actions-go/go-action
https://github.com/actions-go/go-action
automation cd ci github github-actions github-actions-golang golang golang-examples workflow
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/actions-go/go-action
- Owner: actions-go
- License: mit
- Created: 2020-01-17T00:10:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T20:41:55.000Z (about 1 year ago)
- Last Synced: 2024-09-29T21:21:44.461Z (about 2 months ago)
- Topics: automation, cd, ci, github, github-actions, github-actions-golang, golang, golang-examples, workflow
- Language: Go
- Size: 11.6 MB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```bash
$ go mod download
```Build the code
```bash
$ go build
```Run the tests :heavy_check_mark:
```bash
$ 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](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
## 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).
```bash
$ git checkout -b releases/v1
$ git commit -a -m "prod dependencies"
``````bash
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1
```Your action is now published! :rocket:
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
## Usage:
After testing you can [create a v1 tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) to reference the stable and tested action
```yaml
uses: actions-go/go-action@master
with:
milliseconds: 1000
```