https://github.com/skx/github-action-build
Build a project, creating artifacts
https://github.com/skx/github-action-build
build github github-action
Last synced: 9 months ago
JSON representation
Build a project, creating artifacts
- Host: GitHub
- URL: https://github.com/skx/github-action-build
- Owner: skx
- Created: 2019-09-13T18:53:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T11:55:49.000Z (over 5 years ago)
- Last Synced: 2025-04-16T01:49:23.692Z (9 months ago)
- Topics: build, github, github-action
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 13
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# 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.
* Perhaps using my [github-action-publish-binaries](https://github.com/skx/github-action-publish-binaries/) action.
## 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`:
```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:
* [https://github.com/skx/github-action-publish-binaries](https://github.com/skx/github-action-publish-binaries)
Of course you can specify a different script name, via the `builder` argument in your workflow file.