Skip to content

Build a project, creating artifacts

Notifications You must be signed in to change notification settings

skx/github-action-build

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for building a project

This repository contains a simple GitHub Action implementation, which allows you to build your project, in a repository-specific fashion.

The expectation is that you would create an action-based workflow:

  • Checkout the code.
  • Run the tests.
  • Run the build, generating your artifacts.
  • Upload the artifacts.

Enabling the action

There are two steps required to use this action:

  • Enable the action inside your repository.
    • This might mean creating a file .github/workflows/release.yml which is where the action is invoked for release-steps, for example.
  • Add your project-specific .github/build script.
    • This is the script which will actually carry out your build-steps.
      • A C-project might just run make.
      • A golang-based project might run go build . multiple times for different architectures.

Sample Configuration

This configuration runs the script .github/build every time a release is made of your project, and is defined in the file .github/workflows/release.yml:

on:
  release:
    types: [created]
name: Handle Release
jobs:
  generate:
    name: Create release-artifacts
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Generate
      uses: skx/github-action-build@master
      with:
        builder: .github/build

We assume that the .github/build script generated a series of binaries, and these can be acccessed by later steps in your workflow. For example you might use my uploading-action:

Of course you can specify a different script name, via the builder argument in your workflow file.