diff --git a/.github/actions/download/action.yml b/.github/actions/download/action.yml new file mode 100644 index 0000000..5627950 --- /dev/null +++ b/.github/actions/download/action.yml @@ -0,0 +1,28 @@ +name: download-artifact + +description: Download Artifact + +inputs: + platform: + description: Platform + required: true + +runs: + using: composite + steps: + - uses: actions/download-artifact@v3 + with: + name: ${{ inputs.platform }}.env + path: ${{ inputs.platform }}.env + - name: Env to output + shell: bash + run: | + sed -i 's/\r//g' ${{ inputs.platform }}.env/sorac.env + source ${{ inputs.platform }}.env/sorac.env + echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT + echo "$PACKAGE_NAME/$PACKAGE_NAME" >> package_paths.env + id: env + - uses: actions/download-artifact@v3 + with: + name: ${{ steps.env.outputs.package_name }} + path: ${{ steps.env.outputs.package_name }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9bc829a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,94 @@ +name: build-workflow + +on: + push: + paths-ignore: + - "doc/**" + - "**.md" + - "LICENSE" + - "NOTICE" + +jobs: + build-macos: + strategy: + fail-fast: false + matrix: + name: + - macos_arm64 + name: Build sora-c-sdk for ${{ matrix.name }} + runs-on: macos-13 + steps: + - uses: actions/checkout@v4 + - run: python3 run.py --sumomo --package ${{ matrix.name }} + - name: Get package name + run: | + source _package/${{ matrix.name }}/release/sorac.env + echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT + id: package_name + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.package_name.outputs.name }} + path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }} + - name: Upload Environment + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.name }}.env + path: _package/${{ matrix.name }}/release/sorac.env + build-ubuntu: + strategy: + fail-fast: false + matrix: + name: + - ubuntu-20.04_x86_64 + - ubuntu-22.04_x86_64 + name: Build sora-c-sdk for ${{ matrix.name }} + runs-on: ${{ matrix.name == 'ubuntu-22.04_x86_64' && 'ubuntu-22.04' || 'ubuntu-20.04' }} + steps: + - uses: actions/checkout@v4 + - run: python3 run.py --sumomo --package ${{ matrix.name }} + - name: Get package name + run: | + source _package/${{ matrix.name }}/release/sorac.env + echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT + id: package_name + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.package_name.outputs.name }} + path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }} + - name: Upload Environment + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.name }}.env + path: _package/${{ matrix.name }}/release/sorac.env + create-release: + name: Create Release + if: contains(github.ref, 'tags/202') + needs: + - build-macos + - build-ubuntu + runs-on: ubuntu-latest + steps: + - uses: ./.github/actions/download + with: + platform: macos_arm64 + - uses: ./.github/actions/download + with: + platform: ubuntu-20.04_x86_64 + - uses: ./.github/actions/download + with: + platform: ubuntu-22.04_x86_64 + - uses: ./.github/actions/download + with: + platform: android + - name: Env to output + run: | + echo "package_paths<> $GITHUB_OUTPUT + cat package_paths.env >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + id: env + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ${{ steps.env.outputs.package_paths }} diff --git a/.gitignore b/.gitignore index 84931ac..1449beb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /_source /_build /_install +/_package /run.sh /libopenh264-*.so /libopenh264-*.dylib