Skip to content

Commit e8dd686

Browse files
committed
Migrate to submodules
1 parent 1a089aa commit e8dd686

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+9534
-1388
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
labels: []
5+
directory: /
6+
target-branch: dev
7+
schedule:
8+
interval: monthly
9+
10+
- package-ecosystem: npm
11+
labels: []
12+
directory: /
13+
target-branch: dev
14+
schedule:
15+
interval: monthly

.github/workflows/build.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build pull request
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
target_arch: [x86_64, x86, arm64-v8a, armeabi-v7a]
16+
fail-fast: false
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: 'true'
22+
23+
- name: Setup NDK
24+
uses: nttld/setup-ndk@v1
25+
id: setup-ndk
26+
with:
27+
ndk-version: r27c
28+
add-to-path: false
29+
30+
- name: Patch
31+
run: bash ./patch.sh
32+
33+
- name: Compile protoc
34+
run: |
35+
mkdir -p src/protobuf/build
36+
pushd src/protobuf/build
37+
cmake -GNinja -Dprotobuf_BUILD_TESTS=OFF ..
38+
ninja -j$(nproc --all)
39+
popd
40+
41+
- name: Compile aapt2
42+
env:
43+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
44+
PROTOC_PATH: "/${{ github.workspace }}/src/protobuf/build/protoc"
45+
run: bash ./build.sh ${{ matrix.target_arch }}
46+
47+
- name: Upload artifacts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: aapt2-${{ matrix.target_arch }}
51+
path: ${{ github.workspace }}/build/bin/aapt2-*
52+
if-no-files-found: error
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Open a PR to main
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
workflow_dispatch:
8+
9+
env:
10+
MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main`
11+
12+
permissions:
13+
pull-requests: write
14+
15+
jobs:
16+
pull-request:
17+
name: Open pull request
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Open pull request
24+
uses: repo-sync/pull-request@v2
25+
with:
26+
destination_branch: 'main'
27+
pr_title: 'chore: ${{ env.MESSAGE }}'
28+
pr_body: 'This pull request will ${{ env.MESSAGE }}.'
29+
pr_draft: true

.github/workflows/release.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
10+
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
target_arch: [x86_64, x86, arm64-v8a, armeabi-v7a]
17+
fail-fast: false
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: 'true'
23+
24+
- name: Setup NDK
25+
uses: nttld/setup-ndk@v1
26+
id: setup-ndk
27+
with:
28+
ndk-version: r27c
29+
add-to-path: false
30+
31+
- name: Patch
32+
run: bash ./patch.sh
33+
34+
- name: Compile protoc
35+
run: |
36+
mkdir -p src/protobuf/build
37+
pushd src/protobuf/build
38+
cmake -GNinja -Dprotobuf_BUILD_TESTS=OFF ..
39+
ninja -j$(nproc --all)
40+
popd
41+
42+
- name: Compile aapt2
43+
env:
44+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
45+
PROTOC_PATH: "/${{ github.workspace }}/src/protobuf/build/protoc"
46+
run: bash ./build.sh ${{ matrix.target_arch }}
47+
48+
- name: Upload artifacts
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: aapt2-${{ matrix.target_arch }}
52+
path: ${{ github.workspace }}/build/bin/aapt2-*
53+
if-no-files-found: error
54+
55+
release:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
permissions:
59+
id-token: write
60+
contents: write
61+
attestations: write
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
with:
66+
# Make sure the release step uses its own credentials:
67+
# https://github.com/cycjimmy/semantic-release-action#private-packages
68+
persist-credentials: false
69+
70+
- name: Download all built artifacts
71+
uses: actions/download-artifact@v4
72+
with:
73+
path: ./artifacts
74+
merge-multiple: true
75+
76+
- name: Generate attestations
77+
if: ${{ steps.release.outputs.release_created }}
78+
uses: actions/attest-build-provenance@v2
79+
with:
80+
subject-path: ./artifacts/aapt2-*
81+
82+
- name: Setup Node.js
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: "lts/*"
86+
cache: 'npm'
87+
88+
- name: Install dependencies
89+
run: npm install
90+
91+
- name: Import GPG key
92+
uses: crazy-max/ghaction-import-gpg@v6
93+
with:
94+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
95+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
96+
fingerprint: ${{ vars.GPG_FINGERPRINT }}
97+
98+
- name: Release
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
run: npm exec semantic-release

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
bin/
2-
build/
2+
build/
3+
# For CI
4+
artifacts/

.gitmodules

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[submodule "src/expat"]
22
shallow = true
33
path = src/expat
4-
url = https://android.googlesource.com/platform/external/expat.git
4+
url = https://android.googlesource.com/platform/external/expat
55
[submodule "src/fmtlib"]
66
shallow = true
77
path = src/fmtlib
8-
url = https://android.googlesource.com/platform/external/fmtlib.git
8+
url = https://android.googlesource.com/platform/external/fmtlib
99
[submodule "src/boringssl"]
1010
shallow = true
1111
path = src/boringssl
12-
url = https://boringssl.googlesource.com/boringssl.git
12+
url = https://android.googlesource.com/platform/external/boringssl
1313
[submodule "src/incremental_delivery"]
1414
shallow = true
1515
path = src/incremental_delivery
@@ -21,31 +21,27 @@
2121
[submodule "src/libpng"]
2222
shallow = true
2323
path = src/libpng
24-
url = https://android.googlesource.com/platform/external/libpng.git
24+
url = https://android.googlesource.com/platform/external/libpng
2525
[submodule "src/pcre"]
2626
shallow = true
2727
path = src/pcre
28-
url = https://android.googlesource.com/platform/external/pcre.git
29-
[submodule "src/zopfli"]
30-
shallow = true
31-
path = src/zopfli
32-
url = https://android.googlesource.com/platform/external/zopfli
28+
url = https://android.googlesource.com/platform/external/pcre
3329
[submodule "src/protobuf"]
3430
shallow = true
3531
path = src/protobuf
3632
url = https://android.googlesource.com/platform/external/protobuf
3733
[submodule "src/logging"]
3834
shallow = true
3935
path = src/logging
40-
url = https://android.googlesource.com/platform/system/logging.git
36+
url = https://android.googlesource.com/platform/system/logging
4137
[submodule "src/selinux"]
4238
shallow = true
4339
path = src/selinux
44-
url = https://android.googlesource.com/platform/external/selinux.git
40+
url = https://android.googlesource.com/platform/external/selinux
4541
[submodule "src/core"]
4642
shallow = true
4743
path = src/core
48-
url = https://android.googlesource.com/platform/system/core.git
44+
url = https://android.googlesource.com/platform/system/core
4945
[submodule "src/base"]
5046
shallow = true
5147
path = src/base
@@ -54,3 +50,23 @@
5450
shallow = true
5551
path = src/libziparchive
5652
url = https://android.googlesource.com/platform/system/libziparchive
53+
[submodule "src/soong"]
54+
shallow = true
55+
path = src/soong
56+
url = https://android.googlesource.com/platform/build/soong
57+
[submodule "src/unwinding"]
58+
shallow = true
59+
path = src/unwinding
60+
url = https://android.googlesource.com/platform/system/unwinding
61+
[submodule "src/jsoncpp"]
62+
shallow = true
63+
path = src/jsoncpp
64+
url = https://android.googlesource.com/platform/external/jsoncpp
65+
[submodule "src/googletest"]
66+
shallow = true
67+
path = src/googletest
68+
url = https://android.googlesource.com/platform/external/googletest
69+
[submodule "src/native"]
70+
shallow = true
71+
path = src/native
72+
url = https://android.googlesource.com/platform/frameworks/native

.releaserc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "dev",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
[
11+
"@semantic-release/commit-analyzer", {
12+
"releaseRules": [
13+
{ "type": "build", "scope": "Needs bump", "release": "patch" }
14+
]
15+
}
16+
],
17+
"@semantic-release/release-notes-generator",
18+
"@semantic-release/changelog",
19+
[
20+
"@semantic-release/git",
21+
{
22+
"assets": ["CHANGELOG.md", "VERSION"],
23+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
24+
}
25+
],
26+
[
27+
"@saithodev/semantic-release-backmerge",
28+
{
29+
backmergeBranches: [{"from": "main", "to": "dev"}],
30+
clearWorkspace: true
31+
}
32+
],
33+
[
34+
"@semantic-release/github",
35+
{
36+
successComment: false,
37+
assets: [
38+
{
39+
"path": "artifacts/aapt2-*"
40+
}
41+
]
42+
}
43+
]
44+
]
45+
}

0 commit comments

Comments
 (0)