Skip to content

Merge pull request #294 from ourfor/develop #803

Merge pull request #294 from ourfor/develop

Merge pull request #294 from ourfor/develop #803

Workflow file for this run

name: 🌸 Build
permissions:
contents: write
on:
push:
branches: [ "main" ]
paths-ignore:
- 'doc/**'
- '.editorconfig'
- '.gitignore'
- 'Copyright'
- 'README.md'
- 'RELEASE_NOTES'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'doc/**'
- '.editorconfig'
- '.gitignore'
- 'Copyright'
- 'README.md'
- 'RELEASE_NOTES'
jobs:
build:
name: 🌸 Build
runs-on: macos-14
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GH_PAT }}
- name: 🐧 set up Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: "5.10.1"
- name: ☕️ set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: 🔨 Select Xcode version
run: |
# ls /Applications/
sudo xcode-select --switch /Applications/Xcode_15.4.app
export TOOLCHAINS=swift
swift --version
- name: 🕸️ Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 🕸️ Cache CocoaPods
uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: 🧱 Install Dependencies
run: |
npm install
cd ios && pod install
- name: 🧬 Build
env:
scheme: ${{ 'default' }}
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
run: |
exec &> build.log
rm -rf ios/iPlayClient.xcworkspace/xcshareddata/swiftpm/Package.resolved
make all
- name: ⬆️ Upload Build Log if Build Fails
if: failure()
run: |
buildtime=$(date '+%Y%m%d.%H%M')
python -m pip install requests
echo "Uploaded build.log"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/build.log" \
--file "$PWD/build.log" \
--token "${{ secrets.CLIENT_ID }}"
# - name: ✈️ Upload app to TestFlight
# uses: apple-actions/upload-testflight-build@v1
# with:
# app-path: build/iPlay.ipa
# issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
# api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
# api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
# - name: ⬆️ Upload Build Artifact To GitHub
# uses: actions/upload-artifact@v3
# with:
# name: artifact
# path: |
# build/*.apk
# build/*.ipa
# build/*.aab
- name: 🎊 Release Notes
run: |
echo "version_code=$(git rev-list --count HEAD)" >> $GITHUB_ENV
echo "build_id=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo version_name="v1.0 $(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: 🎉 Publish Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/main')
with:
name: ${{ env.version_name }}
tag_name: v1.0.${{ env.version_code }}
make_latest: true
files: |
build/*.apk
build/*.ipa
build/*.aab
- name: ⬆️ Upload Build Artifact
env:
scheme: ${{ 'default' }}
run: |
buildtime=$(date '+%Y%m%d.%H%M')
python -m pip install requests
echo "Uploading build artifacts..."
# echo "Uploaded iPlay.ipa"
# python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay.ipa" \
# --file "$PWD/build/iPlay.ipa" \
# --token "${{ secrets.CLIENT_ID }}"
echo "Uploaded iPlay.apk"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay-x86_64.apk" \
--file "$PWD/build/iPlay-x86_64.apk" \
--token "${{ secrets.CLIENT_ID }}"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay-arm64-v8a.apk" \
--file "$PWD/build/iPlay-arm64-v8a.apk" \
--token "${{ secrets.CLIENT_ID }}"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay-armeabi-v7a.apk" \
--file "$PWD/build/iPlay-armeabi-v7a.apk" \
--token "${{ secrets.CLIENT_ID }}"