feat: First phase of CMake build system implementation (#1072)
There are a lot of changes in this first phase, because there was a
lot of infrastructure required to get some meaningful amount of
porting done. Future PRs should be simpler.
<b>Summary of changes:</b><details>
- Remove old deps:
- boringssl (replaced with mbedtls, lighter, easier to build)
- gflags (replaced with absl::flags)
- Chromium build tools
- New deps to replace parts of Chromium base:
- abseil-cpp
- glog
- nlohmann::json (for tests only)
- Submodules, updates, and CMake build rules for third-party
libraries:
- curl
- gmock/gtest
- Ported internal libraries and their tests by removing Chromium deps
and adding CMake build rules:
- file (now using C++17 filesystem APIs)
- license_notice
- status
- version
- Test improvements
- Removed file tests that can never be re-enabled
- Re-enabled all other disabled file tests
- Debug JSON values when HTTP tests fail
- Fixed chunked-encoding issues in HTTP tests
- Updated and refactored Dockerfiles testing
- All docker files working, with OS versions updated to meet the
new tool requirements
- Local docker builds no longer write files to your working
directory as root
- Local docker builds can now be run in parallel without clobbering
each others' build outputs
- DEBUG=1 can drop you into an interactive shell when a docker
build fails
- Updated and heavily refactored workflows and Dockerfiles
- All docker files now tested in parallel on GitHub, speeding up CI
- All common workflow components broken out and using workflow_call
instead of custom actions
- Self-hosted runners now optional, to make testing easier on forks
- CMake porting works-in-process can now be fully tested on GitHub
- Building ported libraries and passing ported tests on all three
platforms!
- CI hacks for macOS removed, now testing on macos-latest!
- Python2 no longer required! (Only Python3)
- Using strict build flags, treating all warnings as errors.
</details>
<b>Required to build:</b>
- CMake >= 3.16
- Python 3
- A compiler supporting C++ >= 17
- g++ >= 9 if using GCC (Clang also fine)
- MSVC for Windows
<b>Still needs work:</b><details>
- Moving other dependencies into submodules (if we keep them):
- apple_apsl
- icu
- libevent
- libpng
- libwebm
- libxml
- modp_b64
- protobuf
- zlib
- Port remaining internal libraries:
- app
- hls
- media/base
- media/chunking
- media/codecs
- media/crypto
- media/demuxer
- media/event
- media/formats/dvb
- media/formats/mp2t
- media/formats/mp4
- media/formats/packed_audio
- media/formats/ttml
- media/formats/webm
- media/formats/webvtt
- media/formats/wvm
- media/origin
- media/public
- media/replicator
- media/trick_play
- mpd
- Port main application
- Add logging flags in absl and connect them to glog (which expects
gflags)
- Port pssh-box.py
- Port main test targets (packager_test.py and packager_app.py)
- Updating all requirement and build documentation
- Remove any remaining refs to gclient, depot_tools, ninja
- Update and complete release workflows using release-please
</details>
Issue #346 (Switch to abseil)
Issue #1047 (New build system)
2022-08-16 18:34:51 +00:00
|
|
|
# Copyright 2022 Google LLC
|
|
|
|
#
|
2022-08-26 15:44:59 +00:00
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file or at
|
|
|
|
# https://developers.google.com/open-source/licenses/bsd
|
feat: First phase of CMake build system implementation (#1072)
There are a lot of changes in this first phase, because there was a
lot of infrastructure required to get some meaningful amount of
porting done. Future PRs should be simpler.
<b>Summary of changes:</b><details>
- Remove old deps:
- boringssl (replaced with mbedtls, lighter, easier to build)
- gflags (replaced with absl::flags)
- Chromium build tools
- New deps to replace parts of Chromium base:
- abseil-cpp
- glog
- nlohmann::json (for tests only)
- Submodules, updates, and CMake build rules for third-party
libraries:
- curl
- gmock/gtest
- Ported internal libraries and their tests by removing Chromium deps
and adding CMake build rules:
- file (now using C++17 filesystem APIs)
- license_notice
- status
- version
- Test improvements
- Removed file tests that can never be re-enabled
- Re-enabled all other disabled file tests
- Debug JSON values when HTTP tests fail
- Fixed chunked-encoding issues in HTTP tests
- Updated and refactored Dockerfiles testing
- All docker files working, with OS versions updated to meet the
new tool requirements
- Local docker builds no longer write files to your working
directory as root
- Local docker builds can now be run in parallel without clobbering
each others' build outputs
- DEBUG=1 can drop you into an interactive shell when a docker
build fails
- Updated and heavily refactored workflows and Dockerfiles
- All docker files now tested in parallel on GitHub, speeding up CI
- All common workflow components broken out and using workflow_call
instead of custom actions
- Self-hosted runners now optional, to make testing easier on forks
- CMake porting works-in-process can now be fully tested on GitHub
- Building ported libraries and passing ported tests on all three
platforms!
- CI hacks for macOS removed, now testing on macos-latest!
- Python2 no longer required! (Only Python3)
- Using strict build flags, treating all warnings as errors.
</details>
<b>Required to build:</b>
- CMake >= 3.16
- Python 3
- A compiler supporting C++ >= 17
- g++ >= 9 if using GCC (Clang also fine)
- MSVC for Windows
<b>Still needs work:</b><details>
- Moving other dependencies into submodules (if we keep them):
- apple_apsl
- icu
- libevent
- libpng
- libwebm
- libxml
- modp_b64
- protobuf
- zlib
- Port remaining internal libraries:
- app
- hls
- media/base
- media/chunking
- media/codecs
- media/crypto
- media/demuxer
- media/event
- media/formats/dvb
- media/formats/mp2t
- media/formats/mp4
- media/formats/packed_audio
- media/formats/ttml
- media/formats/webm
- media/formats/webvtt
- media/formats/wvm
- media/origin
- media/public
- media/replicator
- media/trick_play
- mpd
- Port main application
- Add logging flags in absl and connect them to glog (which expects
gflags)
- Port pssh-box.py
- Port main test targets (packager_test.py and packager_app.py)
- Updating all requirement and build documentation
- Remove any remaining refs to gclient, depot_tools, ninja
- Update and complete release workflows using release-please
</details>
Issue #346 (Switch to abseil)
Issue #1047 (New build system)
2022-08-16 18:34:51 +00:00
|
|
|
|
|
|
|
name: GitHub Release
|
|
|
|
|
|
|
|
# Runs when a new tag is created that looks like a version number.
|
|
|
|
#
|
|
|
|
# 1. Creates a draft release on GitHub with the latest release notes
|
|
|
|
# 2. On all combinations of OS, build type, and library type:
|
|
|
|
# a. builds Packager
|
|
|
|
# b. builds the docs
|
|
|
|
# c. runs all tests
|
|
|
|
# d. attaches build artifacts to the release
|
|
|
|
# 3. Fully publishes the release on GitHub
|
|
|
|
#
|
|
|
|
# Publishing the release then triggers additional workflows for NPM, Docker
|
|
|
|
# Hub, and GitHub Pages.
|
|
|
|
#
|
|
|
|
# Can also be run manually for debugging purposes.
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*.*"
|
|
|
|
# For manual debugging:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: "An existing tag to release."
|
|
|
|
required: True
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# TODO(joeyparrish): Switch to release-please
|
|
|
|
setup:
|
|
|
|
name: Setup
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
tag: ${{ steps.compute_tag.outputs.tag }}
|
|
|
|
steps:
|
|
|
|
- name: Compute tag
|
|
|
|
id: compute_tag
|
|
|
|
# We could be building from a workflow dispatch (manual run)
|
|
|
|
# or from a pushed tag. If triggered from a pushed tag, we would like
|
|
|
|
# to strip refs/tags/ off of the incoming ref and just use the tag
|
|
|
|
# name. Subsequent jobs can refer to the "tag" output of this job to
|
|
|
|
# determine the correct tag name in all cases.
|
|
|
|
run: |
|
|
|
|
# Strip refs/tags/ from the input to get the tag name, then store
|
|
|
|
# that in output.
|
|
|
|
echo "::set-output name=tag::${{ github.event.inputs.tag || github.ref }}" \
|
|
|
|
| sed -e 's@refs/tags/@@'
|
|
|
|
|
|
|
|
# TODO(joeyparrish): Switch to release-please
|
|
|
|
draft_release:
|
|
|
|
name: Create GitHub release
|
|
|
|
needs: setup
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
release_id: ${{ steps.draft_release.outputs.id }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-07-17 23:11:52 +00:00
|
|
|
uses: actions/checkout@v3
|
feat: First phase of CMake build system implementation (#1072)
There are a lot of changes in this first phase, because there was a
lot of infrastructure required to get some meaningful amount of
porting done. Future PRs should be simpler.
<b>Summary of changes:</b><details>
- Remove old deps:
- boringssl (replaced with mbedtls, lighter, easier to build)
- gflags (replaced with absl::flags)
- Chromium build tools
- New deps to replace parts of Chromium base:
- abseil-cpp
- glog
- nlohmann::json (for tests only)
- Submodules, updates, and CMake build rules for third-party
libraries:
- curl
- gmock/gtest
- Ported internal libraries and their tests by removing Chromium deps
and adding CMake build rules:
- file (now using C++17 filesystem APIs)
- license_notice
- status
- version
- Test improvements
- Removed file tests that can never be re-enabled
- Re-enabled all other disabled file tests
- Debug JSON values when HTTP tests fail
- Fixed chunked-encoding issues in HTTP tests
- Updated and refactored Dockerfiles testing
- All docker files working, with OS versions updated to meet the
new tool requirements
- Local docker builds no longer write files to your working
directory as root
- Local docker builds can now be run in parallel without clobbering
each others' build outputs
- DEBUG=1 can drop you into an interactive shell when a docker
build fails
- Updated and heavily refactored workflows and Dockerfiles
- All docker files now tested in parallel on GitHub, speeding up CI
- All common workflow components broken out and using workflow_call
instead of custom actions
- Self-hosted runners now optional, to make testing easier on forks
- CMake porting works-in-process can now be fully tested on GitHub
- Building ported libraries and passing ported tests on all three
platforms!
- CI hacks for macOS removed, now testing on macos-latest!
- Python2 no longer required! (Only Python3)
- Using strict build flags, treating all warnings as errors.
</details>
<b>Required to build:</b>
- CMake >= 3.16
- Python 3
- A compiler supporting C++ >= 17
- g++ >= 9 if using GCC (Clang also fine)
- MSVC for Windows
<b>Still needs work:</b><details>
- Moving other dependencies into submodules (if we keep them):
- apple_apsl
- icu
- libevent
- libpng
- libwebm
- libxml
- modp_b64
- protobuf
- zlib
- Port remaining internal libraries:
- app
- hls
- media/base
- media/chunking
- media/codecs
- media/crypto
- media/demuxer
- media/event
- media/formats/dvb
- media/formats/mp2t
- media/formats/mp4
- media/formats/packed_audio
- media/formats/ttml
- media/formats/webm
- media/formats/webvtt
- media/formats/wvm
- media/origin
- media/public
- media/replicator
- media/trick_play
- mpd
- Port main application
- Add logging flags in absl and connect them to glog (which expects
gflags)
- Port pssh-box.py
- Port main test targets (packager_test.py and packager_app.py)
- Updating all requirement and build documentation
- Remove any remaining refs to gclient, depot_tools, ninja
- Update and complete release workflows using release-please
</details>
Issue #346 (Switch to abseil)
Issue #1047 (New build system)
2022-08-16 18:34:51 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ needs.setup.outputs.tag }}
|
|
|
|
|
|
|
|
- name: Check changelog version
|
|
|
|
# This check prevents releases without appropriate changelog updates.
|
|
|
|
run: |
|
|
|
|
VERSION=$(packager/tools/extract_from_changelog.py --version)
|
|
|
|
if [[ "$VERSION" != "${{ needs.setup.outputs.tag }}" ]]; then
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "***** ***** *****"
|
|
|
|
echo ""
|
|
|
|
echo "Version mismatch!"
|
|
|
|
echo "Workflow is targetting ${{ needs.setup.outputs.tag }},"
|
|
|
|
echo "but CHANGELOG.md contains $VERSION!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Extract release notes
|
|
|
|
run: |
|
|
|
|
packager/tools/extract_from_changelog.py --release_notes \
|
|
|
|
| tee ../RELEASE_NOTES.md
|
|
|
|
|
|
|
|
- name: Draft release
|
|
|
|
id: draft_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ needs.setup.outputs.tag }}
|
|
|
|
release_name: ${{ needs.setup.outputs.tag }}
|
|
|
|
body_path: RELEASE_NOTES.md
|
|
|
|
draft: true
|
|
|
|
|
|
|
|
lint:
|
|
|
|
needs: setup
|
|
|
|
name: Lint
|
|
|
|
uses: ./.github/workflows/lint.yaml
|
|
|
|
with:
|
|
|
|
ref: ${{ needs.setup.outputs.tag }}
|
|
|
|
|
|
|
|
build_and_test:
|
|
|
|
needs: [setup, lint, draft_release]
|
|
|
|
name: Build and test
|
|
|
|
uses: ./.github/workflows/build.yaml
|
|
|
|
with:
|
|
|
|
ref: ${{ needs.setup.outputs.tag }}
|
|
|
|
|
|
|
|
test_supported_linux_distros:
|
|
|
|
# Doesn't really "need" it, but let's not waste time on a series of docker
|
|
|
|
# builds just to cancel it because of a linter error.
|
|
|
|
needs: lint
|
|
|
|
name: Test Linux distros
|
|
|
|
uses: ./.github/workflows/test-linux-distros.yaml
|
|
|
|
with:
|
|
|
|
ref: ${{ needs.setup.outputs.tag }}
|
|
|
|
|
|
|
|
# TODO(joeyparrish): Switch to release-please
|
|
|
|
publish_release:
|
|
|
|
name: Publish GitHub release
|
|
|
|
needs: [draft_release, build_and_test]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Publish release
|
|
|
|
uses: eregon/publish-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
release_id: ${{ needs.draft_release.outputs.release_id }}
|