From 58bcb147e47bf67d7acbf381da714ea8212b17a6 Mon Sep 17 00:00:00 2001 From: murat Date: Tue, 26 May 2026 18:32:17 +0300 Subject: [PATCH] init github actions for builds --- .github/workflows/build-and-release.yml | 57 +++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build-and-release.yml diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml new file mode 100644 index 0000000..72afb7d --- /dev/null +++ b/.github/workflows/build-and-release.yml @@ -0,0 +1,57 @@ +name: Build and Release + +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + container: debian:11 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install build dependencies + run: apt-get update && apt-get install -y --no-install-recommends make g++ git tar ca-certificates + + - name: Build + run: make clean build + + release: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + container: debian:11 + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install build dependencies + run: apt-get update && apt-get install -y --no-install-recommends make g++ git tar ca-certificates + + - name: Build release tarball + run: make release VERSION=${{ github.ref_name }} + + - name: Upload workflow artifact + uses: actions/upload-artifact@v4 + with: + name: fetchit-${{ github.ref_name }}-linux-x86_64-gnu + path: dist/*.tar.gz + + - name: Publish GitHub release + uses: softprops/action-gh-release@v2 + with: + files: dist/*.tar.gz + generate_release_notes: true