Skip to content

build

build #251

Workflow file for this run

name: build
on:
workflow_dispatch:
inputs:
commitHash:
description: 'webrtc-sdk commit hash'
default: ''
required: true
push:
paths-ignore:
- '**.md'
- 'LICENSE'
- 'NOTICE'
- '.gitignore'
- '.dockerignore'
# branches-ignore:
# - daily
tags:
- '*'
jobs:
build-macos:
defaults:
run:
working-directory: ./build
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
- ios
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Select Xcode 14.3.1
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
- run: brew install ninja
- run: ./build.${{ matrix.name }}.sh "${{ github.event.inputs.commitHash }}"
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: webrtc.${{ matrix.name }}.tar.gz
path: build/_package/${{ matrix.name }}/webrtc.tar.gz
build-linux:
defaults:
run:
working-directory: ./build
strategy:
fail-fast: false
matrix:
name:
- android
runs-on: ${{ matrix.name == 'ubuntu-22.04_x86_64' && 'ubuntu-22.04' || 'ubuntu-20.04' }}
steps:
- uses: actions/checkout@v4
- name: Disk Cleanup
run: |
set -x
df -h
sudo du -h -d1 /usr/local
sudo du -h -d1 /usr/local/share
sudo du -h -d1 /usr/local/lib
sudo du -h -d1 /usr/share
docker rmi `docker images -q -a`
# 4.6G
sudo rm -rf /usr/local/.ghcup
# 1.7G
sudo rm -rf /usr/share/swift
# 1.4G
sudo rm -rf /usr/share/dotnet
# 13G
sudo rm -rf /usr/local/lib/android
df -h
- run: ./build.${{ matrix.name }}.sh "${{ github.event.inputs.commitHash }}"
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: webrtc.${{ matrix.name }}.tar.gz
path: build/_package/${{ matrix.name }}/webrtc.tar.gz
create-release:
name: Create Release
if: contains(github.ref, 'tags/m')
needs:
- build-macos
- build-linux
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Output upload url
shell: bash
run: echo "UPLOAD_URL='${{ steps.create_release.outputs.upload_url }}'" > create-release.env
- name: Upload create-release Environment
uses: actions/upload-artifact@v1
with:
name: create-release.env
path: create-release.env
upload-assets:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
- ios
- android
name: Release ${{ matrix.name }}
if: contains(github.ref, 'tags/m')
needs:
- create-release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download ${{ matrix.name }}
uses: actions/download-artifact@v1
with:
name: webrtc.${{ matrix.name }}.tar.gz
- uses: actions/download-artifact@v1
with:
name: create-release.env
- name: Env to output
shell: bash
run: |
source create-release.env/create-release.env
echo "::set-output name=upload_url::$UPLOAD_URL"
id: env
- name: Upload ${{ matrix.name }} Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ steps.env.outputs.upload_url }}
asset_path: webrtc.${{ matrix.name }}.tar.gz/webrtc.tar.gz
asset_name: webrtc.${{ matrix.name }}.tar.gz
asset_content_type: application/gzip