From cff132c3eff47287171e3eb5bcb42320fabca044 Mon Sep 17 00:00:00 2001 From: birdhimself Date: Thu, 16 Apr 2026 18:27:57 +0200 Subject: [PATCH] ci: implement build and release workflow Add a workflow that builds the project for pull requests and every push to the main branch. On release tags (v*), a release is created automatically with the built binary attached. Refs: #1 --- .github/workflows/build.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 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..3fb2760 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version: '1.26' + + - name: Build + run: make build + + - name: Upload Binary + uses: actions/upload-artifact@v7 + with: + name: compatdata-humanizer + path: compatdata-humanizer + archive: false + + release: + needs: build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download Artifact + uses: actions/download-artifact@v8 + with: + name: compatdata-humanizer + path: dist/ + + - name: Create GitHub Release + uses: softprops/action-gh-release@v3 + with: + files: dist/**