From 6d4e09d9d068333bfd0754e984b3852e73e2d75f Mon Sep 17 00:00:00 2001 From: whoeevee <94960726+whoeevee@users.noreply.github.com> Date: Sat, 25 May 2024 18:22:27 +0300 Subject: [PATCH] Create build-swift.yml --- .github/workflows/build-swift.yml | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/build-swift.yml diff --git a/.github/workflows/build-swift.yml b/.github/workflows/build-swift.yml new file mode 100644 index 00000000..59d1f1e0 --- /dev/null +++ b/.github/workflows/build-swift.yml @@ -0,0 +1,72 @@ +name: Build Swift + +on: + push: + branches: [ "swift" ] + pull_request: + branches: [ "swift" ] + +jobs: + build: + runs-on: macos-14 + env: + THEOS: ${{ github.workspace }}/theos + steps: + - uses: actions/checkout@v4 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.3' + + - name: Install Theos + run: bash -c "$(curl -fsSL https://raw.githubusercontent.com/theos/theos/master/bin/install-theos)" + + - name: Copy SwiftProtobuf (rootful) + run: | + mkdir swiftprotobuf && cd "$_" + wget https://github.com/whoeevee/EeveeSpotify/releases/download/swift2.0/org.swift.protobuf.swiftprotobuf_1.26.0_iphoneos-arm.deb + ar -x org.swift.protobuf.swiftprotobuf_1.26.0_iphoneos-arm.deb + tar -xvf data.tar.lzma + cp -r Library/Frameworks/SwiftProtobuf.framework $THEOS/lib + + - name: Copy SwiftProtobuf (rootless) + run: | + mkdir swiftprotobuf-rootless && cd "$_" + wget https://github.com/whoeevee/EeveeSpotify/releases/download/swift2.0/org.swift.protobuf.swiftprotobuf_1.26.0_iphoneos-arm64.deb + ar -x org.swift.protobuf.swiftprotobuf_1.26.0_iphoneos-arm64.deb + tar -xvf data.tar.lzma + cp -r var/jb/Library/Frameworks/SwiftProtobuf.framework $THEOS/lib/iphone/rootless + + - name: Install make + run: | + brew install make + echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH + + - name: Build EeveeSpotify (debug) + run: | + make package + echo "filename=$(find . -name '*debug*' -path './packages/*' | cut -d/ -f3)" >> $GITHUB_ENV + - uses: actions/upload-artifact@v4 + with: + name: ${{env.filename}} + path: packages/${{env.filename}} + if-no-files-found: error + + - name: Build EeveeSpotify (rootful) + run: | + make package FINALPACKAGE=1 + echo "filename=$(find . -not -name '*debug*' -path './packages/*' | cut -d/ -f3)" >> $GITHUB_ENV + - uses: actions/upload-artifact@v4 + with: + name: ${{env.filename}} + path: packages/${{env.filename}} + if-no-files-found: error + + - name: Build EeveeSpotify (rootless) + run: | + make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless + echo "filename=$(find . -name '*arm64*' -path './packages/*' | cut -d/ -f3)" >> $GITHUB_ENV + - uses: actions/upload-artifact@v4 + with: + name: ${{env.filename}} + path: packages/${{env.filename}} + if-no-files-found: error