Skip to content

Commit

Permalink
feat(build): 🚀 Added Github Actions pipelines
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Sanino <alessandro@sanino.dev>
  • Loading branch information
saniales committed Jun 28, 2024
1 parent f95e4e4 commit 86e63f5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/compile-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Compile and Test

on:
push:
branches:
- '**'
pull_request:
workflow_call:

env:
GO111MODULE: on
GOPATH: /home/runner/go
GOBIN: /home/runner/go/bin

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- run: make cross-compile
- run: make test
- uses: actions/upload-artifact@v4
with:
name: binaries
path: |
bin/*
30 changes: 30 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Create Github Release

on:
push:
tags:
- 'v*'

jobs:
build-and-test:
uses: "./.github/workflows/compile-and-test.yml"
release:
runs-on: ubuntu-latest
needs: [build-and-test]
steps:
- uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: binaries
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
prerelease: true
fail_on_unmatched_files: true
draft: false
files: |
bin/*
LICENSE
3 changes: 3 additions & 0 deletions cross-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Download bindata if not already downloaded
go install -a -v github.com/go-bindata/go-bindata/...@latest

# Generate bindata assets
go-bindata -nomemcopy -pkg bindata -o ./gen/bindata/bindata.go ./install-scripts/...

Expand Down

0 comments on commit 86e63f5

Please sign in to comment.