Skip to content

Commit

Permalink
add build action
Browse files Browse the repository at this point in the history
  • Loading branch information
XigmaDev committed Nov 18, 2024
1 parent e7434a8 commit 47c11a9
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 31 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_type }}
cancel-in-progress: true
jobs:
Build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
env:
GOPROXY: https://goproxy.io,direct
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: false
check-latest: true
- name: Tidy
run: make tidy
- name: Build
run: make build
- name: UPX
run: |
set -xe
export temp_dir=$(mktemp -d)
cd "$temp_dir"
wget https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-amd64_linux.tar.xz
tar -xvf upx-4.0.2-amd64_linux.tar.xz upx-4.0.2-amd64_linux/upx
mv ./upx-4.0.2-amd64_linux/upx .
cd -
"$temp_dir/upx" --no-color --mono --no-progress --ultra-brute --no-backup ./bin/IPSeekBot
"$temp_dir/upx" --test ./bin/IPSeekBot
rm -rfv "$temp_dir"
- name: Test
run: make test
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.out
flags: unittests
fail_ci_if_error: false
verbose: true
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: ingest
path: ./bin/IPSeekBot
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./bin/IPSeekBot

28 changes: 0 additions & 28 deletions .github/workflows/go.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ run:
.PHONY: build
build:
@echo "Building the bot binary..."
@go build -o $(BINARY_NAME)
@go build -o bin/$(BINARY_NAME)

.PHONY: start
start:
@echo "Starting the bot binary..."
@./$(BINARY_NAME)
@./bin/$(BINARY_NAME)


.PHONY: lint
Expand All @@ -42,7 +42,7 @@ test:
.PHONY: clean
clean:
@echo "Cleaning up..."
@rm -f $(BINARY_NAME)
@rm -f bin/$(BINARY_NAME)

.PHONY: deps
deps:
Expand Down

0 comments on commit 47c11a9

Please sign in to comment.