forked from google/filament
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:google/filament
- Loading branch information
Showing
5,169 changed files
with
835,682 additions
and
613,507 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
|
||
[*.{c,cpp,h,inc,kt,java,js,md}] | ||
indent_style = space | ||
indent_size = 4 | ||
max_line_length = 100 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM python:3.10.4 | ||
|
||
RUN pip3 install pygithub==1.55 | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
COPY verify_release_notes.py /verify_release_notes.py | ||
|
||
RUN chmod +x /verify_release_notes.py | ||
ENTRYPOINT [ "/verify_release_notes.py" ] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: 'Verify Release Notes' | ||
description: 'Verifies that a RELEASE_NOTES file has been modified' | ||
inputs: | ||
repo-token: | ||
description: 'The GitHub token' | ||
required: true | ||
pull-request-number: | ||
description: 'The Pull Request number' | ||
required: true | ||
bypass-label-name: | ||
description: 'The Label used to bypass this check' | ||
required: false | ||
default: 'internal' | ||
release-notes-file: | ||
description: 'The path to the RELEASE_NOTES file' | ||
required: false | ||
default: 'RELEASE_NOTES.md' | ||
pull-request-repo-full-name: | ||
description: 'The full name of the Pull Request repo' | ||
required: false | ||
default: ${{ github.event.pull_request.head.repo.full_name }} | ||
pull-request-head-ref: | ||
description: 'The HEAD ref of the Pull Request' | ||
required: false | ||
default: ${{ github.event.pull_request.head.ref }} | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.repo-token }} | ||
- ${{ inputs.pull-request-number }} | ||
- ${{ inputs.bypass-label-name }} | ||
- ${{ inputs.release-notes-file }} | ||
- ${{ inputs.pull-request-repo-full-name }} | ||
- ${{ inputs.pull-request-head-ref }} |
100 changes: 100 additions & 0 deletions
100
.github/actions/verify-release-notes/verify_release_notes.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2022 The Android Open Source Project | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from github import Github | ||
import sys, os | ||
|
||
def print_usage(): | ||
print('Verify that a GitHub pull request modifies a RELEASE_NOTES file') | ||
print() | ||
print('Usage:') | ||
print(' verify_release_notes.py [arguments]') | ||
print() | ||
print('Arguments:') | ||
print('1. github token') | ||
print('2. pull request number') | ||
print('3. bypass label name') | ||
print('4. release notes file path') | ||
print('5. pull request repo full name') | ||
print('6. pull request head ref') | ||
print() | ||
print('The GITHUB_REPOSITORY environment variable must be set (e.g., google/filament).') | ||
|
||
def leave_single_comment(pull_request, comment_body): | ||
""" Leaves a comment on a PR once, without leaving a duplicate comment. """ | ||
# To avoid spamming the PR author, we'll use this comment tag (which will render invisibly on | ||
# GitHub) to check if we've already left a comment on this PR. | ||
COMMENT_TAG = '<!-- verify_release_notes -->\n' | ||
comments = pull_request.get_issue_comments() | ||
for comment in comments: | ||
if comment.body.find(COMMENT_TAG) != -1: | ||
return | ||
# The GitHub token may not have WRITE permissions to leave a comment (for example, for 3P | ||
# contributors). In that case, we simply won't leave a comment. | ||
try: | ||
pull_request.create_issue_comment(f'{COMMENT_TAG}{comment_body}') | ||
except: | ||
print("Unable to leave comment. Continuing.") | ||
|
||
# The first argument is the path to this script. | ||
if len(sys.argv) != 7: | ||
print_usage() | ||
sys.exit(1) | ||
|
||
authentication_token = sys.argv[1] | ||
pull_number = sys.argv[2] | ||
bypass_label_name = sys.argv[3] | ||
release_notes_file = sys.argv[4] | ||
pr_repo_full_name = sys.argv[5] | ||
pr_head_ref = sys.argv[6] | ||
|
||
g = Github(authentication_token) | ||
|
||
repo_name = os.environ.get('GITHUB_REPOSITORY') | ||
if repo_name is None: | ||
print("The GITHUB_REPOSITORY environment variable must be set.") | ||
sys.exit(1) | ||
|
||
repo = g.get_repo(repo_name) | ||
|
||
pull_request = repo.get_pull(int(pull_number)) | ||
|
||
# First check if the PR has the "bypass" label. This label is used for PRs that don't need to update | ||
# RELEASE_NOTES. If so, we can exit immediately. | ||
labels = [l.name for l in pull_request.labels] | ||
if bypass_label_name in labels: | ||
print(f"PR number {pull_number} in repo {repo_name} contains the '{bypass_label_name}' label.") | ||
print("Exiting with success.") | ||
sys.exit(0) | ||
|
||
# Next, check if the release notes file (RELEASE_NOTES.md or similar) has been modified. | ||
files = pull_request.get_files() | ||
for file in files: | ||
if file.filename == release_notes_file: | ||
print(f"PR number {pull_number} in repo {repo_name} modifies '{release_notes_file}'.") | ||
print("Exiting with success.") | ||
sys.exit(0) | ||
|
||
# At this point, we issue a warning to the PR author to remember to modify the release notes, and | ||
# exit with failure. | ||
edit_url = f"https://github.com/{pr_repo_full_name}/edit/{pr_head_ref}/{release_notes_file}" | ||
comment = (f"Please add a release note line to [{release_notes_file}]({edit_url}). " | ||
f"If this PR does not warrant a release note, add the '{bypass_label_name}' label " | ||
f"to this PR.") | ||
print(comment) | ||
leave_single_comment(pull_request, comment) | ||
|
||
sys.exit(1) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,11 @@ jobs: | |
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Run build script | ||
run: | | ||
cd build/android && printf "y" | ./build.sh continuous | ||
|
@@ -25,18 +29,10 @@ jobs: | |
with: | ||
name: filamat-android-full | ||
path: out/filamat-android-release.aar | ||
- uses: actions/[email protected] | ||
with: | ||
name: filamat-android-lite | ||
path: out/filamat-android-lite-release.aar | ||
- uses: actions/[email protected] | ||
with: | ||
name: gltfio-android-release | ||
path: out/gltfio-android-release.aar | ||
- uses: actions/[email protected] | ||
with: | ||
name: gltfio-android-lite-release | ||
path: out/gltfio-android-lite-release.aar | ||
- uses: actions/[email protected] | ||
with: | ||
name: filament-utils-android-release | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CocoaPods Deploy | ||
|
||
# This must be run after the iOS release job has finished, and the iOS release | ||
# asset has been uploaded to Github. | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_tag: | ||
description: 'Release tag to deploy (e.g., v1.42.2)' | ||
required: true | ||
default: 'v1.42.2' | ||
|
||
jobs: | ||
cocoapods-deploy: | ||
name: cocoapods-deploy | ||
runs-on: macos-latest | ||
steps: | ||
- name: Check out iOS/CocoaPods directory | ||
uses: Bhacaz/checkout-files@49fc3050859046bf4f4873678d46099985640e89 | ||
with: | ||
files: ios/CocoaPods | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.event.inputs.release_tag }} | ||
- name: Move podspec to root | ||
run: mv ios/CocoaPods/*.podspec . | ||
- name: Install CocoaPods | ||
run: gem install cocoapods | ||
- uses: michaelhenry/deploy-to-cocoapods-github-action@745686ab065f90596e0d5cfcf97bb2416d94262e | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,14 @@ jobs: | |
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2.0.0 | ||
- uses: actions/checkout@v3.3.0 | ||
- name: Run build script | ||
run: | | ||
cd build/mac && printf "y" | ./build.sh continuous | ||
- uses: actions/[email protected] | ||
with: | ||
name: filament-mac | ||
path: out/filament-release-darwin.tgz | ||
- name: Check public headers | ||
run: | | ||
build/common/check-headers.sh out/release/filament/include |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Npm Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_tag: | ||
description: 'Release tag to deploy (e.g., v1.42.2)' | ||
required: true | ||
default: 'v1.42.2' | ||
|
||
jobs: | ||
npm-deploy: | ||
name: npm-deploy | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.inputs.release_tag }} | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Run build script | ||
run: | | ||
cd build/web && printf "y" | ./build.sh release | ||
- name: Deploy to npm | ||
run: | | ||
cd out/cmake-webgl-release/web/filament-js | ||
npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,10 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-18.04] | ||
os: [macos-latest, ubuntu-22.04] | ||
|
||
steps: | ||
- uses: actions/checkout@v2.0.0 | ||
- uses: actions/checkout@v3.3.0 | ||
- name: Run build script | ||
run: | | ||
WORKFLOW_OS=`echo \`uname\` | sed "s/Darwin/mac/" | tr [:upper:] [:lower:]` | ||
|
@@ -29,10 +29,10 @@ jobs: | |
build-windows: | ||
name: build-windows | ||
runs-on: windows-latest | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
- uses: actions/checkout@v2.0.0 | ||
- uses: actions/checkout@v3.3.0 | ||
- name: Run build script | ||
run: | | ||
build\windows\build-github.bat presubmit | ||
|
@@ -43,7 +43,11 @@ jobs: | |
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Run build script | ||
run: | | ||
cd build/android && printf "y" | ./build.sh presubmit | ||
|
@@ -53,7 +57,7 @@ jobs: | |
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2.0.0 | ||
- uses: actions/checkout@v3.3.0 | ||
- name: Run build script | ||
run: | | ||
cd build/ios && printf "y" | ./build.sh presubmit | ||
|
@@ -66,7 +70,7 @@ jobs: | |
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2.0.0 | ||
- uses: actions/checkout@v3.3.0 | ||
- name: Run build script | ||
run: | | ||
cd build/web && printf "y" | ./build.sh presubmit |
Oops, something went wrong.