https://github.com/thatisuday/go-cross-build
GitHub Action to build Go (Golang) modules.
https://github.com/thatisuday/go-cross-build
ci-cd gihub gihub-actions golang golang-action
Last synced: 2 months ago
JSON representation
GitHub Action to build Go (Golang) modules.
- Host: GitHub
- URL: https://github.com/thatisuday/go-cross-build
- Owner: thatisuday
- Created: 2020-04-11T11:57:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-11T14:13:33.000Z (almost 2 years ago)
- Last Synced: 2025-04-02T12:09:18.592Z (2 months ago)
- Topics: ci-cd, gihub, gihub-actions, golang, golang-action
- Language: Go
- Homepage: https://itnext.io/how-to-set-up-github-workflows-and-create-github-actions-using-docker-3a5ba7ec0988
- Size: 97.7 KB
- Stars: 40
- Watchers: 1
- Forks: 31
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Action: go-build-action
This actions generates cross-platform executable files from a Go module.
> Automatic release management of the [**tree**](https://github.com/thatisuday/tree/releases) CLI tool using **go-build-action** action.## Workflow setup
```yaml
# workflow name
name: Generate release-artifacts# on events
on:
release:
types:
- created# workflow tasks
jobs:
generate:
name: Generate cross-platform builds
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Generate build files
uses: thatisuday/go-cross-build@v1
with:
platforms: 'linux/amd64, darwin/amd64, windows/amd64'
package: 'demo'
name: 'program'
compress: 'true'
dest: 'dist'
```#### ☉ option: **platforms**
The `platforms` option specifies comma-separated platform names to create binary-executable files for. To see the list of supported platforms, use `go tool dist list` command.#### ☉ option: **package**
If the module (_repository_) itself is a Go package, then `package` option value should be an empty string (''). If the repository contains a package directory, then `package` value should be the directory name.#### ☉ option: **compress**
The `compress` option if set to `'true'` will generate **compressed-tar** archive files for the each platform-build file. The resulting archive file also contains `README.md` and `LICENSE` file if they exist inside the root of the repository. In this mode, the binary executable file name is taken from the `name` option value.#### ☉ option: **name**
The `name` option sets a prefix for the build filenames. In compression mode, this prefix is applied to archive files and binary executable filename is set to this value.#### ☉ option: **dest**
The `dest` option sets the output directory for the build files. This should be a relative directory without leading `./`.## Build Artifacts
This action produces following build-artifacts.#### In non-compression mode
```
.//
├── -darwin-amd64
├── -linux-amd64
├── ...
└── -windows-amd64.exe
```#### In compression mode
```
.//
├── -darwin-amd64.tar.gz
| ├──
| ├── LICENSE
| └── README.md
├── -linux-amd64.tar.gz
| ├──
| ├── LICENSE
| └── README.md
├── ...
└── -windows-amd64.tar.gz
├── .exe
├── LICENSE
└── README.md
```