Boost ビルドを iOS に合わせる #2480
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-workflow | |
| on: | |
| push: | |
| paths-ignore: | |
| - "doc/**" | |
| - "**.md" | |
| - "LICENSE" | |
| - "NOTICE" | |
| - ".github/workflows/e2e-test.yml" | |
| - "e2e-test/**" | |
| branches: | |
| - "develop" | |
| - "feature/**" | |
| tags: | |
| - "**" | |
| schedule: | |
| # UTC の 01:00 は JST だと 10:00 。 | |
| # 1-5 で 月曜日から金曜日 | |
| - cron: "0 1 * * 1-5" | |
| workflow_dispatch: | |
| jobs: | |
| build-macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: | |
| - macos_arm64 | |
| - ios | |
| - visionos | |
| name: Build sora-cpp-sdk for ${{ matrix.name }} | |
| runs-on: macos-14 | |
| env: | |
| TEST_SIGNALING_URL: ${{ secrets.TEST_SIGNALING_URL }} | |
| TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} | |
| TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} | |
| TEST_MATRIX_NAME: ${{ matrix.name }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Env to output | |
| run: | | |
| echo "user=`users`" >> $GITHUB_OUTPUT | |
| id: env | |
| - run: python3 run.py build --test --run-e2e-test --package ${{ matrix.name }} | |
| if: matrix.name != 'visionos' | |
| - run: python3 run.py build --package ${{ matrix.name }} | |
| if: matrix.name == 'visionos' | |
| - name: Get package name | |
| run: | | |
| source _package/${{ matrix.name }}/release/sora.env | |
| echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT | |
| echo "boost_name=${BOOST_PACKAGE_NAME}" >> $GITHUB_OUTPUT | |
| id: package_name | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ steps.package_name.outputs.name }} | |
| path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }} | |
| - name: Upload Boost Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ steps.package_name.outputs.boost_name }} | |
| path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.boost_name }} | |
| - name: Upload Environment | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ matrix.name }}.env | |
| path: _package/${{ matrix.name }}/release/sora.env | |
| - name: Build Examples | |
| run: | | |
| cd examples | |
| mkdir examples_${{ matrix.name }} | |
| for app in sdl_sample sumomo messaging_recvonly_sample; do | |
| python3 $app/run.py build ${{ matrix.name }} --local-sora-cpp-sdk-dir .. | |
| cp _build/${{ matrix.name }}/release/$app/$app examples_${{ matrix.name }} | |
| done | |
| if: matrix.name == 'macos_arm64' | |
| - name: Upload Examples Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: examples_${{ matrix.name }} | |
| path: examples/examples_${{ matrix.name }} | |
| if: matrix.name == 'macos_arm64' | |
| # e2e-test: | |
| # name: E2E Test | |
| # needs: | |
| # - build-macos | |
| # uses: ./.github/workflows/e2e-test.yml | |
| # secrets: inherit | |
| create-release: | |
| name: Create Release | |
| if: contains(github.ref, 'tags/202') | |
| needs: | |
| - build-macos | |
| # - e2e-test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/download | |
| with: | |
| platform: macos_arm64 | |
| - uses: ./.github/actions/download | |
| with: | |
| platform: ios | |
| - uses: ./.github/actions/download | |
| with: | |
| platform: visionos | |
| - name: Env to output | |
| run: | | |
| # package_paths.env の内容を空白区切りに変換 | |
| PACKAGE_PATHS=$(tr '\n' ' ' < package_paths.env) | |
| echo "package_paths=${PACKAGE_PATHS}" >> $GITHUB_OUTPUT | |
| id: env | |
| - name: Release (Prerelease) | |
| if: contains(github.ref, 'canary') | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --prerelease \ | |
| --title "${{ github.ref_name }}" \ | |
| ${{ steps.env.outputs.package_paths }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Release | |
| if: ${{ !contains(github.ref, 'canary') }} | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --title "${{ github.ref_name }}" \ | |
| ${{ steps.env.outputs.package_paths }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| build-macos-examples: | |
| needs: create-release | |
| strategy: | |
| matrix: | |
| example: | |
| - sumomo | |
| defaults: | |
| run: | |
| working-directory: ${{ github.workspace }}/examples | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build Example | |
| run: | | |
| python3 ${{ matrix.example }}/run.py build macos_arm64 | |
| - name: Package Binary | |
| run: | | |
| # アップロード用のディレクトリを作成する | |
| mkdir -p ${{ matrix.example }}_macos_arm64 | |
| cp _build/macos_arm64/release/${{ matrix.example }}/${{ matrix.example }} ${{ matrix.example }}_macos_arm64/${{ matrix.example }} | |
| # バイナリを圧縮する | |
| # 例: sumomo_macos_arm64.tar.gz | |
| tar -czf ${{ matrix.example }}_macos_arm64.tar.gz ${{ matrix.example }}_macos_arm64 | |
| - name: Upload Examples Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ matrix.example }}_macos_arm64.tar.gz | |
| path: examples/${{ matrix.example }}_macos_arm64.tar.gz | |
| create-release-example: | |
| name: Create Release Examples | |
| needs: | |
| - build-macos-examples | |
| strategy: | |
| matrix: | |
| example: | |
| - sumomo | |
| archive: | |
| - macos_arm64.tar.gz | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: ${{ matrix.example }}_${{ matrix.archive }} | |
| - name: Release Examples | |
| run: | | |
| gh release upload "${{ github.ref_name }}" \ | |
| "${{ matrix.example }}_${{ matrix.archive }}" \ | |
| --clobber | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| notification: | |
| name: Slack Notification | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - build-macos | |
| # - e2e-test | |
| - create-release | |
| - build-macos-examples | |
| - create-release-example | |
| if: always() | |
| steps: | |
| - uses: rtCamp/action-slack-notify@v2 | |
| if: | | |
| needs.build-macos.result == 'failure' || | |
| needs.create-release.result == 'failure' || | |
| needs.build-macos-examples.result == 'failure' || | |
| needs.create-release-example.result == 'failure' | |
| env: | |
| SLACK_CHANNEL: sora-cpp-sdk | |
| SLACK_COLOR: danger | |
| SLACK_TITLE: Build failed | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |