From eeb09284d39c4ce324e5b3dcfa044d91896f9710 Mon Sep 17 00:00:00 2001 From: h0tak88r Date: Mon, 3 Feb 2025 19:29:20 +0200 Subject: [PATCH] ci: add github actions build workflow --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4204d75 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build and Test + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y android-sdk + wget https://github.com/skylot/jadx/releases/download/v1.4.3/jadx-1.4.3.zip + unzip jadx-1.4.3.zip + sudo mv jadx/bin/jadx /usr/local/bin/ + sudo mv jadx/bin/jadx-gui /usr/local/bin/ + + - name: Build + run: | + go mod tidy + go build -v ./... + + - name: Test + run: go test -v ./... + + - name: Create Release Artifact + if: github.event_name == 'push' + run: | + mkdir dist + go build -o dist/apkx ./cmd/apkx/main.go + zip -r apkx-${{ github.sha }}.zip dist/* + + - name: Upload Artifact + if: github.event_name == 'push' + uses: actions/upload-artifact@v3 + with: + name: apkx-build + path: apkx-*.zip