|
16 | 16 | build:
|
17 | 17 | name: build
|
18 | 18 | runs-on: ubuntu-latest
|
19 |
| - permissions: |
20 |
| - id-token: write |
21 |
| - attestations: write |
22 | 19 | strategy:
|
23 | 20 | matrix:
|
24 | 21 | target_arch: [x86_64, x86, arm64-v8a, armeabi-v7a]
|
@@ -47,16 +44,51 @@ jobs:
|
47 | 44 | cmake -GNinja -Dprotobuf_BUILD_TESTS=OFF ..
|
48 | 45 | ninja -j$(nproc --all)
|
49 | 46 | popd
|
50 |
| - env: |
51 |
| - NDK_TOOLCHAIN: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64 |
52 | 47 |
|
53 | 48 | - name: Compiling aapt2
|
54 | 49 | run: python3 ./build.py --ndk=${{ steps.setup-ndk.outputs.ndk-path }} --abi=${{ matrix.target_arch }} --build="build/${{ matrix.target_arch }}" --protoc=/${{ github.workspace }}/src/protobuf/build/protoc --target aapt2
|
55 |
| - env: |
56 |
| - NDK_TOOLCHAIN: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64 |
57 | 50 |
|
58 | 51 | - name: Upload artifacts
|
59 | 52 | uses: actions/upload-artifact@v4
|
60 | 53 | with:
|
61 | 54 | name: aapt2-${{ matrix.target_arch }}
|
62 |
| - path: ${{ github.workspace }}/build/${{ matrix.target_arch }}/bin/aapt2 |
| 55 | + path: ${{ github.workspace }}/build/${{ matrix.target_arch }}/bin/aapt2-* |
| 56 | + if-no-files-found: error |
| 57 | + |
| 58 | + release: |
| 59 | + needs: build |
| 60 | + if: github.ref == 'refs/heads/main' |
| 61 | + runs-on: ubuntu-latest |
| 62 | + permissions: |
| 63 | + id-token: write |
| 64 | + contents: write |
| 65 | + pull-requests: write |
| 66 | + attestations: write |
| 67 | + steps: |
| 68 | + - name: Downloading artifact from all |
| 69 | + uses: actions/download-artifact@v4 |
| 70 | + with: |
| 71 | + path: ./artifacts |
| 72 | + |
| 73 | + - name: List |
| 74 | + run: | |
| 75 | + ls -la ./artifacts/ |
| 76 | +
|
| 77 | + - name: Creating release |
| 78 | + uses: googleapis/release-please-action@v4 |
| 79 | + if : ${{ hashFiles('artifacts/*') != '' }} |
| 80 | + id: release |
| 81 | + with: |
| 82 | + release-type: simple |
| 83 | + |
| 84 | + - name: Generating attestation of the generated aapt2 |
| 85 | + if: ${{ steps.release.outputs.release_created }} |
| 86 | + uses: actions/attest-build-provenance@v2 |
| 87 | + with: |
| 88 | + subject-path: ./artifacts/aapt2-*/aapt2-* |
| 89 | + |
| 90 | + - name: Uploading release artifact |
| 91 | + if: ${{ steps.release.outputs.release_created }} |
| 92 | + env: |
| 93 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 94 | + run: gh release upload --repo ${{ github.repository }} ${{ steps.release.outputs.tag_name }} ./artifacts/aapt2-*/aapt2-* |
0 commit comments