GithubHelp home page GithubHelp logo

netphantom / go-cross-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thatisuday/go-cross-build

0.0 0.0 0.0 102 KB

GitHub Action to build Go (Golang) modules.

Home Page: https://itnext.io/how-to-set-up-github-workflows-and-create-github-actions-using-docker-3a5ba7ec0988

Dockerfile 4.15% Go 95.85%

go-cross-build's Introduction

GitHub Action: go-build-action

###The original fork of this project can be found here:

###https://github.com/thatisuday/go-cross-build

This actions generates cross-platform executable files from a Go module.

release

Automatic release management of the tree CLI tool using go-build-action action.

Workflow setup

# 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'
            addfolder: 'templates'

☉ 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 ./.

☉ option: addfolder

The addfolder options allows to add a single project folder in the compressed file.

Build Artifacts

This action produces following build-artifacts.

In non-compression mode

./<dest>/
  ├── <name>-darwin-amd64
  ├── <name>-linux-amd64
  ├── ...
  └── <name>-windows-amd64.exe

In compression mode

./<dest>/
  ├── <name>-darwin-amd64.tar.gz
  |  ├── <name>
  |  ├── LICENSE
  |  └── README.md
  ├── <name>-linux-amd64.tar.gz
  |  ├── <name>
  |  ├── LICENSE
  |  └── README.md
  ├── ...
  └── <name>-windows-amd64.tar.gz
     ├── <name>.exe
     ├── LICENSE
     └── README.md

In compression mode with addfolder

./<dest>/
  ├── <name>-darwin-amd64.tar.gz
  |  ├── <folder>
  |  ├── <name>
  |  ├── LICENSE
  |  └── README.md
  ├── <name>-linux-amd64.tar.gz
  |  ├── <folder>
  |  ├── <name>
  |  ├── LICENSE
  |  └── README.md
  ├── ...
  └── <name>-windows-amd64.tar.gz
     ├── <folder>
     ├── <name>.exe
     ├── LICENSE
     └── README.md

go-cross-build's People

Contributors

thatisuday avatar tobyxdd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.