Update asset paths for iOS libraries in release step #8
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: Go | |
| on: | |
| push: | |
| branches: ["master"] | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: "Which part of the version to bump?" | |
| required: false | |
| default: "patch" | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| jobs: | |
| determine-version: | |
| if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.next_version.outputs.tag }} | |
| current_tag: ${{ steps.current_tag.outputs.current_tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get Current Tag | |
| id: current_tag | |
| run: | | |
| current_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "v0.0.0") | |
| echo "current_tag=$current_tag" >> $GITHUB_ENV | |
| echo "::set-output name=current_tag::$current_tag" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Determine next version | |
| id: next_version | |
| uses: actions/github-script@v6 | |
| env: | |
| BUMP: ${{ github.event.inputs.bump || 'patch' }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const bump = process.env.BUMP || 'patch'; | |
| console.log(`Selected bump: ${bump}`); | |
| const latest = await github.rest.repos.getLatestRelease({ owner, repo }).catch(() => null); | |
| const currentVersion = latest ? latest.data.tag_name.replace(/^v/, '') : '0.0.0'; | |
| let [major, minor, patch] = currentVersion.split('.').map(Number); | |
| switch (bump) { | |
| case 'major': | |
| major++; | |
| minor = 0; | |
| patch = 0; | |
| break; | |
| case 'minor': | |
| minor++; | |
| patch = 0; | |
| break; | |
| default: | |
| patch++; | |
| } | |
| const nextVersion = `v${major}.${minor}.${patch}`; | |
| console.log(`Next version: ${nextVersion}`); | |
| core.setOutput('tag', nextVersion); | |
| build: | |
| runs-on: macos-latest | |
| needs: determine-version | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| submodules: "recursive" | |
| - name: Install protobuf | |
| run: brew install protobuf | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios | |
| - name: Build IOS | |
| run: ./build_ios.sh | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-build | |
| path: | | |
| rust-sdks/target/aarch64-apple-ios/release/liblivekit_ffi.a | |
| rust-sdks/target/aarch64-apple-ios/release/liblivekit_ffi.dylib | |
| rust-sdks/target/aarch64-apple-ios-sim/release/liblivekit_ffi.a | |
| rust-sdks/target/aarch64-apple-ios-sim/release/liblivekit_ffi.dylib | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - determine-version | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: List downloaded files | |
| run: | | |
| echo "Listing downloaded artifacts:" | |
| find . -type f -name "*.a" -o -name "*.dylib" | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ needs.determine-version.outputs.tag }} | |
| release_name: Release ${{ needs.determine-version.outputs.tag }} | |
| draft: false | |
| body: | | |
| **Full Changelog**: https://github.com/argon-chat/lk_build/compare/${{ needs.determine-version.outputs.current_tag }}...${{ needs.determine-version.outputs.tag }} | |
| prerelease: false | |
| - name: Upload iOS Device Library (Static) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./ios-build/aarch64-apple-ios/release/liblivekit_ffi.a | |
| asset_name: liblivekit_ffi-aarch64-apple-ios.a | |
| asset_content_type: application/octet-stream | |
| - name: Upload iOS Device Library (Dynamic) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./ios-build/aarch64-apple-ios/release/liblivekit_ffi.dylib | |
| asset_name: liblivekit_ffi-aarch64-apple-ios.dylib | |
| asset_content_type: application/octet-stream | |
| - name: Upload iOS Simulator Library (Static) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./ios-build/aarch64-apple-ios-sim/release/liblivekit_ffi.a | |
| asset_name: liblivekit_ffi-aarch64-apple-ios-sim.a | |
| asset_content_type: application/octet-stream | |
| - name: Upload iOS Simulator Library (Dynamic) | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./ios-build/aarch64-apple-ios-sim/release/liblivekit_ffi.dylib | |
| asset_name: liblivekit_ffi-aarch64-apple-ios-sim.dylib | |
| asset_content_type: application/octet-stream |