Start Adding GitHub Actions (#1165)
Summary: This change starts adding more coverage to GitHub Actions. Existing workflows are split up to be per-platform, and stale scripts, etc are removed. We are currently limited a bit by issues with the build itself, but this still adds a good bit of coverage that readily works, and adds places to inject more. Another option would have been to move these to CircleCI where we have more credits, or used docker images instead of manual setup steps. etc, The Yoga build and number of changes is very light though, so we don't really need the complexity yet. Some TODOs: 1. Fix the Apple Builds (pod lint and pod install return errors seen by the community) 2. Add working Android UTs 3. Add C++ UTs 4. Add Apple Publish 5. Add version stamping Changelog: [Internal][Added] - Start Adding Yoga GitHub Actions Pull Request resolved: https://github.com/facebook/yoga/pull/1165 Reviewed By: cortinico Differential Revision: D40386426 Pulled By: NickGerleman fbshipit-source-id: c540dd25bfec6ac8c05e461c1236ef7fe6cb8598
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c2a0ccf0d4
commit
e9184c793e
112
.clang-format
112
.clang-format
@@ -54,3 +54,115 @@ SpaceInEmptyParentheses: false
|
|||||||
SpacesBeforeTrailingComments: 1
|
SpacesBeforeTrailingComments: 1
|
||||||
Standard: Cpp11
|
Standard: Cpp11
|
||||||
UseTab: Never
|
UseTab: Never
|
||||||
|
---
|
||||||
|
Language: ObjC
|
||||||
|
AccessModifierOffset: -1
|
||||||
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
|
AlignConsecutiveMacros: false
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveBitFields: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
AlignOperands: DontAlign
|
||||||
|
AlignTrailingComments: false
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
|
AllowAllConstructorInitializersOnNextLine: true
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortEnumsOnASingleLine: true
|
||||||
|
AllowShortBlocksOnASingleLine: Never
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
|
AllowShortLambdasOnASingleLine: All
|
||||||
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakBeforeMultilineStrings: true
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackArguments: false
|
||||||
|
BinPackParameters: false
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeBraces: Attach
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeColon
|
||||||
|
BreakAfterJavaFieldAnnotations: false
|
||||||
|
BreakStringLiterals: false
|
||||||
|
ColumnLimit: 80
|
||||||
|
CommentPragmas: '^ IWYU pragma:'
|
||||||
|
CompactNamespaces: false
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
DeriveLineEnding: true
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
DisableFormat: false
|
||||||
|
FixNamespaceComments: true
|
||||||
|
ForEachMacros:
|
||||||
|
- FOR_EACH
|
||||||
|
- FOR_EACH_R
|
||||||
|
- FOR_EACH_RANGE
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
IncludeCategories:
|
||||||
|
- Regex: '^<.*\.h(pp)?>'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '^<.*'
|
||||||
|
Priority: 2
|
||||||
|
- Regex: '.*'
|
||||||
|
Priority: 3
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentCaseBlocks: false
|
||||||
|
IndentGotoLabels: true
|
||||||
|
IndentPPDirectives: None
|
||||||
|
IndentExternBlock: AfterExternBlock
|
||||||
|
IndentWidth: 2
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
InsertTrailingCommas: None
|
||||||
|
JavaScriptQuotes: Leave
|
||||||
|
JavaScriptWrapImports: true
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
MacroBlockBegin: ''
|
||||||
|
MacroBlockEnd: ''
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
ObjCBinPackProtocolList: Auto
|
||||||
|
ObjCBlockIndentWidth: 2
|
||||||
|
ObjCBreakBeforeNestedBlockParam: true
|
||||||
|
ObjCSpaceAfterProperty: false
|
||||||
|
ObjCSpaceBeforeProtocolList: false
|
||||||
|
PenaltyBreakAssignment: 2
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 1
|
||||||
|
PenaltyBreakComment: 300
|
||||||
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakString: 1000
|
||||||
|
PenaltyBreakTemplateDeclaration: 10
|
||||||
|
PenaltyExcessCharacter: 1000000
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 200
|
||||||
|
PointerAlignment: Left
|
||||||
|
ReflowComments: true
|
||||||
|
SortIncludes: true
|
||||||
|
SortUsingDeclarations: true
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceAfterTemplateKeyword: true
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInConditionalStatement: false
|
||||||
|
SpacesInContainerLiterals: true
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
SpaceBeforeSquareBrackets: false
|
||||||
|
Standard: Latest
|
||||||
|
TabWidth: 8
|
||||||
|
UseCRLF: false
|
||||||
|
UseTab: Never
|
||||||
|
...
|
||||||
|
24
.github/actions/clang-format/action.yml
vendored
Normal file
24
.github/actions/clang-format/action.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Clang Format
|
||||||
|
inputs:
|
||||||
|
directory:
|
||||||
|
description: Directory to Lint
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: LLVM version to use # Should be kept roughly in sync with arcanist
|
||||||
|
required: false
|
||||||
|
default: 12
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install
|
||||||
|
shell: bash
|
||||||
|
run: sudo apt-get install -y clang-format-${{ inputs.version }}
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
working-directory: ${{ inputs.directory }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
shopt -s globstar
|
||||||
|
shopt -s nullglob
|
||||||
|
clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm
|
13
.github/actions/setup-android/action.yml
vendored
Normal file
13
.github/actions/setup-android/action.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
name: Setup Android envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install JDK 1.8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
|
||||||
|
- name: Install NDK 21
|
||||||
|
shell: bash
|
||||||
|
run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT}
|
9
.github/actions/setup-apple/action.yml
vendored
Normal file
9
.github/actions/setup-apple/action.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: Setup Apple envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
# TODO: This and Ruby should be versioned
|
||||||
|
- name: Install Cocoapods
|
||||||
|
shell: bash
|
||||||
|
run: sudo gem install cocoapods
|
14
.github/actions/setup-website/action.yml
vendored
Normal file
14
.github/actions/setup-website/action.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: Setup Website envirionment
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install NodeJS 12
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
|
||||||
|
- name: yarn install
|
||||||
|
shell: bash
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
working-directory: website
|
58
.github/workflows/ci.yml
vendored
58
.github/workflows/ci.yml
vendored
@@ -1,58 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
website:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: 12.x
|
|
||||||
- name: Install dependencies
|
|
||||||
run: yarn install --frozen-lockfile --ignore-scripts
|
|
||||||
working-directory: website
|
|
||||||
- name: Build
|
|
||||||
run: yarn build
|
|
||||||
working-directory: website
|
|
||||||
- name: Deploy
|
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_branch: gh-pages
|
|
||||||
publish_dir: website/public
|
|
||||||
cname: yogalayout.com
|
|
||||||
keep_files: true
|
|
||||||
user_name: 'Yoga-bot'
|
|
||||||
user_email: 'yogabot@fb.com'
|
|
||||||
android:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Install NDK 21
|
|
||||||
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
if [[ -n "${{ secrets.encrypted_d27e803291ff_iv }}" ]]; then
|
|
||||||
openssl aes-256-cbc -K ${{ secrets.encrypted_d27e803291ff_key }} -iv {{ secrets.encrypted_d27e803291ff_iv }} -in scripts/setup-keys.enc -d >> gradle.properties;
|
|
||||||
fi
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y ninja-build
|
|
||||||
pushd $HOME
|
|
||||||
git clone --depth 1 https://github.com/facebook/buck.git
|
|
||||||
cd buck
|
|
||||||
ant
|
|
||||||
popd
|
|
||||||
echo "$HOME/buck/bin" >> $GITHUB_PATH
|
|
||||||
export PATH=$PATH:$HOME/buck/bin/
|
|
||||||
buck --version
|
|
||||||
- name: Build
|
|
||||||
# TODO: Run the tests here again. They're currently crashing the JVM in GitHub Actions for some reason.
|
|
||||||
run: ./gradlew :yoga-layout:assembleDebug
|
|
29
.github/workflows/publish-android.yml
vendored
Normal file
29
.github/workflows/publish-android.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Android
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to Maven Central
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-android
|
||||||
|
|
||||||
|
- name: Publish and release
|
||||||
|
run: |
|
||||||
|
./gradlew :yoga:assembleRelease publish --info
|
||||||
|
./gradlew closeAndReleaseRepository
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
|
||||||
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
|
||||||
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}
|
||||||
|
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
|
||||||
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
|
32
.github/workflows/publish-website.yml
vendored
Normal file
32
.github/workflows/publish-website.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish to GitHub Pages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-website
|
||||||
|
|
||||||
|
- name: yarn build
|
||||||
|
run: yarn build
|
||||||
|
working-directory: website
|
||||||
|
|
||||||
|
- uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_branch: gh-pages
|
||||||
|
publish_dir: website/public
|
||||||
|
cname: yogalayout.com
|
||||||
|
keep_files: true
|
||||||
|
user_name: 'Yoga-bot'
|
||||||
|
user_email: 'yogabot@fb.com'
|
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@@ -1,32 +0,0 @@
|
|||||||
name: Publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- created
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Install dependencies
|
|
||||||
run: source scripts/android-setup.sh && installAndroidSDK
|
|
||||||
- name: Write GPG Sec Ring
|
|
||||||
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg
|
|
||||||
- name: Update gradle.properties
|
|
||||||
run: echo -e "signing.secretKeyRingFile=/tmp/secring.gpg\nsigning.keyId=${{ secrets.SIGNING_KEY_ID }}\nsigning.password=${{ secrets.SIGNING_PASSWORD }}\nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}\nmavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties
|
|
||||||
- name: Upload Android Archives
|
|
||||||
run: ./gradlew :yoga:assembleRelease publish --info
|
|
||||||
- name: Release and close
|
|
||||||
run: ./gradlew closeAndReleaseRepository
|
|
||||||
- name: Clean secrets
|
|
||||||
if: always()
|
|
||||||
run: rm /tmp/secring.gpg
|
|
20
.github/workflows/validate-android.yml
vendored
Normal file
20
.github/workflows/validate-android.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: Android
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build (${{ matrix.mode }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
mode: [Debug, Release]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-android
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: ./gradlew assemble${{ matrix.mode }}
|
50
.github/workflows/validate-apple.yml
vendored
Normal file
50
.github/workflows/validate-apple.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
name: Apple
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-pods:
|
||||||
|
name: Lint
|
||||||
|
if: ${{ false }} # Apple Build is Broken
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-apple
|
||||||
|
|
||||||
|
- name: pod spec lint
|
||||||
|
run: pod spec lint --verbose
|
||||||
|
|
||||||
|
build-sample:
|
||||||
|
name: Build (${{ matrix.mode }})
|
||||||
|
if: ${{ false }} # Apple Build is Broken
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
mode: [Debug, Release]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-apple
|
||||||
|
|
||||||
|
- name: pod install
|
||||||
|
working-directory: ./YogaKit/YogaKitSample
|
||||||
|
run: pod install
|
||||||
|
|
||||||
|
# TODO: xcodebuild
|
||||||
|
|
||||||
|
clang-format:
|
||||||
|
name: Format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
uses: ./.github/actions/clang-format
|
||||||
|
with:
|
||||||
|
directory: ./YogaKit
|
16
.github/workflows/validate-cpp.yml
vendored
Normal file
16
.github/workflows/validate-cpp.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: C++
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clang-format:
|
||||||
|
name: Format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
uses: ./.github/actions/clang-format
|
||||||
|
with:
|
||||||
|
directory: ./yoga
|
18
.github/workflows/validate-website.yml
vendored
Normal file
18
.github/workflows/validate-website.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Website
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
uses: ./.github/actions/setup-website
|
||||||
|
|
||||||
|
- name: yarn build
|
||||||
|
run: yarn build
|
||||||
|
working-directory: website
|
26
README.md
26
README.md
@@ -63,26 +63,8 @@ This will now only run the standalone webpack build upon install.
|
|||||||
|
|
||||||
## Maintainer Release Guide
|
## Maintainer Release Guide
|
||||||
|
|
||||||
To publish a new release, follow these steps:
|
Release artifacts are published automatically when a new GitHub release is
|
||||||
|
created. The publishing workflows may also be executed manually, given a Git
|
||||||
|
Tag, to re-attempt publish.
|
||||||
|
|
||||||
1. Ensure you have your GPG key set up and your [OSS Sonatype](https://oss.sonatype.org/) credentials handy.
|
NPM and NuGet packages are not currently published.
|
||||||
2. Add the follow entries to either your local `gradle.properties` (don't forget to revert) or your global `~/.gradle/gradle.properties`:
|
|
||||||
|
|
||||||
```
|
|
||||||
# You get these from https://oss.sonatype.org/#profile;User%20Token
|
|
||||||
mavenCentralRepositoryUsername=<username>
|
|
||||||
mavenCentralRepositoryPassword=<password>
|
|
||||||
|
|
||||||
# You can get the keyId (in GPG 1.4 format) by running `gpg1 --list-keys`.
|
|
||||||
signing.secretKeyRingFile=</path/to/secring.gpg>
|
|
||||||
signing.keyId=<key_id>
|
|
||||||
signing.password=<key_password>
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Change the `VERSION_NAME` in `gradle.properties` to a non-SNAPSHOT release.
|
|
||||||
4. Commit and land the version change.
|
|
||||||
5. Run `./gradlew publishToMaven`.
|
|
||||||
6. Run `./gradlew closeAndReleaseRepository`.
|
|
||||||
7. Change the `VERSION_NAME` in `gradle.properties` back to a new SNAPSHOT release.
|
|
||||||
8. Commit and land the version change.
|
|
||||||
9. Celebrate! You've made a release!
|
|
||||||
|
27
build.gradle
27
build.gradle
@@ -37,33 +37,6 @@ ext {
|
|||||||
targetCompatibilityVersion = JavaVersion.VERSION_1_7
|
targetCompatibilityVersion = JavaVersion.VERSION_1_7
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you have an idea on how to avoid this, please get in touch or
|
|
||||||
// answer https://stackoverflow.com/questions/43867014/how-to-use-the-gradle-ndk-build-to-compile-for-the-host-machine.
|
|
||||||
task copyNativeLibs(type: Copy, dependsOn: ':buckBuildNative') {
|
|
||||||
from "${rootDir}/buck-out/gen/java/tests#default,shared-library-symlink-tree/"
|
|
||||||
include '*.so'
|
|
||||||
include '*.dylib'
|
|
||||||
into "$buildDir/jniLibs"
|
|
||||||
}
|
|
||||||
|
|
||||||
task buckBuildNative(type: Exec) {
|
|
||||||
workingDir rootDir
|
|
||||||
environment BUCKVERSION: 'last'
|
|
||||||
commandLine 'buck', 'build', '//java/...'
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
afterEvaluate {
|
|
||||||
tasks.withType(Test) {
|
|
||||||
dependsOn copyNativeLibs
|
|
||||||
def libDir = "${rootDir}/build/jniLibs"
|
|
||||||
systemProperty 'java.library.path', libDir
|
|
||||||
environment 'LD_LIBRARY_PATH', libDir
|
|
||||||
environment 'DYLD_LIBRARY_PATH', libDir
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
|
10
enums.py
10
enums.py
@@ -72,10 +72,10 @@ def get_license(ext):
|
|||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @generated by enums.py
|
// @{} by enums.py
|
||||||
|
|
||||||
""".format(
|
""".format(
|
||||||
prologue
|
prologue, "generated"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -107,13 +107,13 @@ root = os.path.dirname(os.path.abspath(__file__))
|
|||||||
with open(root + "/yoga/YGEnums.h", "w") as f:
|
with open(root + "/yoga/YGEnums.h", "w") as f:
|
||||||
f.write(get_license("cpp"))
|
f.write(get_license("cpp"))
|
||||||
f.write("#pragma once\n")
|
f.write("#pragma once\n")
|
||||||
f.write("// clang-format: off\n\n")
|
|
||||||
f.write('#include "YGMacros.h"\n\n')
|
f.write('#include "YGMacros.h"\n\n')
|
||||||
|
f.write("// clang-format off\n\n\n")
|
||||||
|
|
||||||
f.write('YG_EXTERN_C_BEGIN\n\n')
|
f.write("YG_EXTERN_C_BEGIN\n\n")
|
||||||
items = sorted(ENUMS.items())
|
items = sorted(ENUMS.items())
|
||||||
for name, values in items:
|
for name, values in items:
|
||||||
if (isinstance(values[0], tuple)):
|
if isinstance(values[0], tuple):
|
||||||
f.write("YG_ENUM_DECL(\n")
|
f.write("YG_ENUM_DECL(\n")
|
||||||
else:
|
else:
|
||||||
f.write("YG_ENUM_SEQ_DECL(\n")
|
f.write("YG_ENUM_SEQ_DECL(\n")
|
||||||
|
@@ -45,10 +45,6 @@ android {
|
|||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
|
||||||
java.srcDirs 'tests'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,56 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the MIT license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function download() {
|
|
||||||
if hash curl 2>/dev/null; then
|
|
||||||
curl -s -L -o "$2" "$1"
|
|
||||||
elif hash wget 2>/dev/null; then
|
|
||||||
wget -O "$2" "$1"
|
|
||||||
else
|
|
||||||
echo >&2 "No supported download tool installed. Please get either wget or curl."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function installsdk() {
|
|
||||||
PROXY_ARGS=""
|
|
||||||
if [[ ! -z "$HTTPS_PROXY" ]]; then
|
|
||||||
PROXY_HOST="$(echo $HTTPS_PROXY | cut -d : -f 1,1)"
|
|
||||||
PROXY_PORT="$(echo $HTTPS_PROXY | cut -d : -f 2,2)"
|
|
||||||
PROXY_ARGS="--proxy=http --proxy_host=$PROXY_HOST --proxy_port=$PROXY_PORT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo y | "$ANDROID_HOME"/tools/bin/sdkmanager $PROXY_ARGS "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
function installAndroidSDK {
|
|
||||||
if [[ ! -d "$HOME/android-sdk" ]]; then
|
|
||||||
TMP=/tmp/sdk$$.zip
|
|
||||||
download 'https://dl.google.com/android/repository/tools_r25.2.3-linux.zip' $TMP
|
|
||||||
unzip -qod "$HOME/android-sdk" $TMP
|
|
||||||
rm $TMP
|
|
||||||
fi
|
|
||||||
|
|
||||||
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
|
|
||||||
if [[ ! -d "$ANDROID_NDK_REPOSITORY/android-ndk-r15c" ]]; then
|
|
||||||
TMP=/tmp/ndk$$.zip
|
|
||||||
mkdir -p "$ANDROID_NDK_REPOSITORY"
|
|
||||||
download 'https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip' $TMP
|
|
||||||
unzip -qod "$ANDROID_NDK_REPOSITORY" "$TMP"
|
|
||||||
rm $TMP
|
|
||||||
fi
|
|
||||||
|
|
||||||
export ANDROID_HOME=$HOME/android-sdk
|
|
||||||
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"
|
|
||||||
|
|
||||||
mkdir -p $ANDROID_HOME/licenses/
|
|
||||||
echo > $ANDROID_HOME/licenses/android-sdk-license
|
|
||||||
echo -n d56f5187479451eabf01fb78af6dfcb131a6481e > $ANDROID_HOME/licenses/android-sdk-license
|
|
||||||
|
|
||||||
installsdk 'build-tools;25.0.3' 'build-tools;26.0.2' 'platforms;android-25' 'platforms;android-26' 'ndk-bundle' 'extras;android;m2repository' 'cmake;3.6.4111459'
|
|
||||||
}
|
|
@@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the MIT license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
ROOTDIR="$(dirname $0)/.."
|
|
||||||
echo -e "\033[1;34m** We can deploy two libraries\n** (1) Java bindings to Yoga\n** (2) Android YogaLayout\n** Which do you want to ship today? \033[0m"
|
|
||||||
read -p "" -n 1 mod
|
|
||||||
case $mod in
|
|
||||||
1 ) MODULE="yoga";;
|
|
||||||
2 ) MODULE="yoga-layout";;
|
|
||||||
* ) echo -e "\n\033[1;34m** Invalid selection" && exit
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo -e "\n\033[1;34m** We'll need your Bintray credentials. If you don't remember them go to https://bintray.com/profile/edit\033[0m"
|
|
||||||
|
|
||||||
echo -e "\033[1;34m** [1/3] Please enter your Bintray username (probably not your email address): \033[0m"
|
|
||||||
read -r BINTRAY_USER
|
|
||||||
echo -e "\033[1;34m** [2/3] Please enter your Bintray API key: \033[0m"
|
|
||||||
read -r BINTRAY_KEY
|
|
||||||
echo -e "\033[1;34m** [3/3] Please enter your GPG passphrase: \033[0m"
|
|
||||||
read -r GPG_PASS
|
|
||||||
|
|
||||||
uploadcmd="$ROOTDIR/gradlew clean :${MODULE}:build bintrayUpload --info -PbintrayUsername='$BINTRAY_USER' -PbintrayApiKey='$BINTRAY_KEY' -PbintrayGpgPassword='$GPG_PASS'"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo -e "\033[1;34m** Dry run\033[0m"
|
|
||||||
|
|
||||||
eval "$uploadcmd -PdryRun=true"
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo -e "\033[1;34m** Are you happy to conintue?: [yN]\033[0m"
|
|
||||||
read -p "" -n 1 yn
|
|
||||||
case $yn in
|
|
||||||
[Yy]* ) ;;
|
|
||||||
* ) echo -e "\n\033[1;34m** Run $0 when you're ready to try again\033[0m" && exit;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo -e "\033[1;34m** Publishing\033[0m"
|
|
||||||
|
|
||||||
eval "$uploadcmd"
|
|
@@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
#
|
|
||||||
# Deploy a SNAPSHOT JAR after every successful CI run To Sonatype.
|
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the MIT license found in the LICENSE
|
|
||||||
# file in the root directory of this source tree.
|
|
||||||
#
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
|
||||||
IS_SNAPSHOT="$(grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' "$BASEDIR/gradle.properties")"
|
|
||||||
|
|
||||||
if [ "$IS_SNAPSHOT" == "" ]; then
|
|
||||||
echo >&2 "Skipping build. Given build doesn't appear to be a SNAPSHOT release."
|
|
||||||
else
|
|
||||||
env TERMINAL=dumb "$BASEDIR/gradlew" publish
|
|
||||||
fi
|
|
@@ -1 +0,0 @@
|
|||||||
k<EFBFBD><EFBFBD><EFBFBD><04><18>=+\M<><4D>n<EFBFBD>mq6<71>P<16><>q<EFBFBD>Z<<3C>c%<25><><1D>j<EFBFBD><6A><EFBFBD>d<EFBFBD><64><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><11>9C7P`]<5D><><EFBFBD><EFBFBD>#<23>Z<EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD>^7<><37><EFBFBD><EFBFBD><EFBFBD>*<2A><><EFBFBD>r<EFBFBD>`L<>A<13>1m<31><6D><EFBFBD>0h<30>n%v<><76>
|
|
@@ -8,10 +8,11 @@
|
|||||||
// @generated by enums.py
|
// @generated by enums.py
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
// clang-format: off
|
|
||||||
|
|
||||||
#include "YGMacros.h"
|
#include "YGMacros.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
|
||||||
YG_EXTERN_C_BEGIN
|
YG_EXTERN_C_BEGIN
|
||||||
|
|
||||||
YG_ENUM_SEQ_DECL(
|
YG_ENUM_SEQ_DECL(
|
||||||
|
Reference in New Issue
Block a user