From 150348c3914e3b28d2e06fd1ffe25bbe5a5924fc Mon Sep 17 00:00:00 2001 From: MassiveBox Date: Sat, 31 May 2025 17:49:30 +0200 Subject: [PATCH] Add Forgejo CI --- .forgejo/workflows/build.yml | 64 ++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ 2 files changed, 66 insertions(+) create mode 100644 .forgejo/workflows/build.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..91f98f6 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,64 @@ +name: Build on Push and create Release on Tag + +on: + push: + branches: + - main + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.24.3 + + - name: Setup Android NDK + id: setup-ndk + uses: https://github.com/nttld/setup-ndk@v1 + with: + ndk-version: r27c + + - name: Install requirements + run: | + apt-get update + apt-get install golang gcc libgl1-mesa-dev xorg-dev libxkbcommon-dev -y + go mod tidy + go install fyne.io/tools/cmd/fyne@latest + + - name: Build app + run: | + cd app + echo "Building for Linux" + fyne package -os linux + echo "Building for Android" + fyne package -os android + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + + - name: Move artifacts + run: | + mkdir release + mv app/FCaster.apk release/ + mv app/FCaster.tar.xz release/ + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + overwrite: true + path: release + + - name: Create release + if: github.ref_type == 'tag' + uses: actions/forgejo-release@v1 + with: + direction: upload + release-dir: release + token: ${{ secrets.FORGE_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1296d0d..b5090e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.apk +*.tar.xz +*.exe .idea