Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Build
run: make
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.PHONY := all

.SHELL := /bin/bash
.SHELLFLAGS := -ec

MOD_NAME := oneoffhax
UTIL_DIRS := $(shell find . -maxdepth 1 -type d -not -path './.git' -not -path '.')
BIN_PATHS := $(shell find . -type f -not -path './.git' -executable)
BIN_DEST := /usr/local/bin/

all: init tidy build copy

clean:
@rm go.mod

init:
@go mod init ${MOD_NAME}

tidy:
@go mod tidy

build:
@for UTIL_DIR in ${UTIL_DIRS}; do \
if [ -d $$UTIL_DIR ]; then \
cd $$UTIL_DIR; \
go build && echo "[+] $$UTIL_DIR built successfully."; \
cd ..; \
fi \
done

copy:
@sudo cp ${BIN_PATHS} ${BIN_DEST}