From 938dd87698f8ec85d12bbba962b3a5a11307fcf1 Mon Sep 17 00:00:00 2001 From: nullchinchilla Date: Tue, 3 Sep 2024 19:55:07 -0400 Subject: [PATCH] Migrate CI from CircleCI to GitHub Actions for macOS, Flatpak, and Windows builds --- .circleci/config.yml | 93 ---------------------------------- .github/workflows/build.yaml | 98 ++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 93 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index f5b0373..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,93 +0,0 @@ -# This config is equivalent to both the '.circleci/extended/orb-free.yml' and the base '.circleci/config.yml' -version: 2.1 - -orbs: - win: circleci/windows@2.2.0 # The Windows orb give you everything you need to start using the Windows executor. - -jobs: - build_macos: - working_directory: ~/repo/ - macos: - xcode: 15.1.0 - resource_class: macos.x86.medium.gen2 - steps: - - checkout - - run: git submodule update --init --recursive - - run: curl https://sh.rustup.rs -sSf | sh -s -- -y - - run: (cd gephgui-wry/gephgui && npm i -f && CI= npm run build) - - run: (cd macos && ./build-macos.bash) - - run: pip3 install --upgrade b2 - - run: b2 authorize-account $B2_KEYID $B2_APPKEY - - run: b2 upload-file geph-dl macos/geph-macos.zip STAGING/geph-macos.zip - - store_artifacts: - path: macos/geph-macos.zip - destination: geph-macos.zip - # build_appimage: - # docker: - # - image: cimg/node:14.9.0 - # steps: - # - checkout - # - run: sudo apt update - # - run: sudo apt install fuse - # - run: git submodule update --init --recursive - # - run: curl https://sh.rustup.rs -sSf | sh -s -- -y - # - run: echo 'export PATH=$HOME/.cargo/bin:$PATH' >> $BASH_ENV - # - run: (cd gephgui-wry/gephgui && npm i && CI= npm run build) - # - run: (cd appimage && bash build-appimage.bash) - # - store_artifacts: - # path: appimage/Geph/Geph-x86_64.AppImage - # destination: Geph-x86_64.AppImage - build_flatpak: - machine: - image: ubuntu-2004:202107-02 - steps: - - checkout - - run: git submodule update --init --recursive - - run: sudo apt update && sudo apt install flatpak-builder flatpak ca-certificates python3-pip - - run: flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - - run: flatpak-builder --force-clean --install-deps-from flathub --user build-dir flatpak/io.geph.GephGui.yml --repo=repo - - run: flatpak build-bundle repo io.geph.GephGui.flatpak io.geph.GephGui --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo - - run: sudo pip3 install --upgrade b2 - - run: b2 authorize-account $B2_KEYID $B2_APPKEY - - run: b2 upload-file geph-dl io.geph.GephGui.flatpak STAGING/Geph-x86_64.flatpak - - store_artifacts: - path: io.geph.GephGui.flatpak - destination: Geph-x86_64.flatpak - build_windows: - executor: - name: win/default - shell: bash.exe - size: xlarge - steps: - - checkout - - run: git submodule update --init --recursive - - run: curl https://win.rustup.rs/ > rustup-init.exe - - run: ./rustup-init -y --default-toolchain "stable-i686-pc-windows-msvc" --profile minimal - - run: (cd gephgui-wry/gephgui && npm i -f && CI= npm run build) - - run: PATH=$PATH:/c/Users/circleci/.cargo/bin CARGO_NET_GIT_FETCH_WITH_CLI=true bash windows/build-windows.bash - # - run: apt install python3-pip - - run: pip install --upgrade b2 - - run: b2 authorize-account $B2_KEYID $B2_APPKEY - - run: b2 upload-file geph-dl windows/Output/geph-windows-setup.exe STAGING/geph-windows-setup.exe - - store_artifacts: - path: windows/Output/geph-windows-setup.exe - destination: geph-windows-setup.exe - -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows -workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. - jobs: - # - build_appimage: - # context: - # - master - - build_flatpak: - context: - - master - - build_windows: - context: - - master - - build_macos: - context: - - master diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..c970a2a --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,98 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build_macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + - name: Set up Rust + run: | + curl https://sh.rustup.rs -sSf | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Build GUI + run: | + cd gephgui-wry/gephgui + npm i -f + CI= npm run build + - name: Build macOS + run: | + cd macos + ./build-macos.bash + - name: Install and configure B2 + run: | + pip3 install --upgrade b2 + b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }} + - name: Upload to B2 + run: b2 upload-file geph-dl macos/geph-macos.zip STAGING/geph-macos.zip + - uses: actions/upload-artifact@v3 + with: + name: geph-macos + path: macos/geph-macos.zip + + build_flatpak: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + - name: Install dependencies + run: | + sudo apt update + sudo apt install flatpak-builder flatpak ca-certificates python3-pip + - name: Set up Flatpak + run: | + flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + - name: Build Flatpak + run: | + flatpak-builder --force-clean --install-deps-from flathub --user build-dir flatpak/io.geph.GephGui.yml --repo=repo + flatpak build-bundle repo io.geph.GephGui.flatpak io.geph.GephGui --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo + - name: Install and configure B2 + run: | + sudo pip3 install --upgrade b2 + b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }} + - name: Upload to B2 + run: b2 upload-file geph-dl io.geph.GephGui.flatpak STAGING/Geph-x86_64.flatpak + - uses: actions/upload-artifact@v3 + with: + name: geph-flatpak + path: io.geph.GephGui.flatpak + + build_windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + - name: Set up Rust + run: | + curl https://win.rustup.rs/ -o rustup-init.exe + ./rustup-init -y --default-toolchain "stable-i686-pc-windows-msvc" --profile minimal + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Build GUI + run: | + cd gephgui-wry/gephgui + npm i -f + CI= npm run build + - name: Build Windows + run: | + $env:PATH += ";C:\Users\runneradmin\.cargo\bin" + $env:CARGO_NET_GIT_FETCH_WITH_CLI = "true" + bash windows/build-windows.bash + - name: Install and configure B2 + run: | + pip install --upgrade b2 + b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }} + - name: Upload to B2 + run: b2 upload-file geph-dl windows/Output/geph-windows-setup.exe STAGING/geph-windows-setup.exe + - uses: actions/upload-artifact@v3 + with: + name: geph-windows + path: windows/Output/geph-windows-setup.exe