From 225d709ed5bd91ad152f6ba720f233c89bf01953 Mon Sep 17 00:00:00 2001 From: Joscha Date: Fri, 14 Feb 2025 18:41:40 +0100 Subject: [PATCH] Set up CI --- .github/workflows/build.yml | 89 +++++++++++++++++++++++++++++++++++++ 1 file changed, 89 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..052a4f6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,89 @@ +# What software is installed by default: +# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources + +name: build + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + build-linux: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + # https://github.com/tauri-apps/tauri-action?tab=readme-ov-file#usage + # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners + - name: Install tauri dependencies + run: | + sudo apt update + sudo apt install libwebkit2gtk-4.1-dev + + - name: Build + run: ./meta/build + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: gdn-linux + path: | + target/release/gdn-cli + target/release/gdn-app + + build-windows: + runs-on: windows-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Build + run: ./meta/build + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: gdn-windows + path: | + target/release/gdn-cli.exe + target/release/gdn-app.exe + + release: + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + needs: + - build-linux + - build-windows + permissions: + contents: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + + - name: Zip artifacts + run: | + zip -r gdn-linux.zip gdn-linux + zip -r gdn-windows.zip gdn-windows + + - name: Create new release + uses: softprops/action-gh-release@v2 + with: + body: Automated release + files: | + gdn-linux.zip + gdn-windows.zip