mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-23 00:12:51 +00:00

By explicitly listing the permissions required in general, repositories without restrictive permissions will only allocate the specified permissions which is much safer than the default, fairly wide, permissions grant. Most workflows don't appear to need any permissions beyond `contents: read` which is required for checkout (when a repository is private). By specifying this permission, it tells GitHub not to include any of its additional default permissions (when a repository is configured permissively). The .github/workflows/memcheck_*.sh scripts called by build_ubuntu.yml require write permissions in order to post their output to a pull request (as a comment). In locked down GitHub repositories, unless a workflow/job asks for write permissions, it will not have them and such API calls will result in: { "message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/issues/comments#create-an-issue-comment", "status": "403" } By specifically requesting the permissions, the workflow will continue to work as expected.
73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
name: Android
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build_x86_64:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: nttld/setup-ndk@v1.3.1
|
|
id: setup-ndk
|
|
with:
|
|
submodules: true
|
|
ndk-version: r21e
|
|
local-cache: true
|
|
|
|
- name: Install Packages
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install meson ninja-build libgles-dev
|
|
|
|
- name: Build
|
|
env:
|
|
NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
API: 21
|
|
run: |
|
|
sed -e "s|NDK|$NDK|g" -e "s|HOST_TAG|linux-x86_64|g" -e "s|API|$API|g" ./cross/android_x86_64.txt > /tmp/android_cross.txt
|
|
meson setup build -Dlog=true -Dengines=all -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true --cross-file /tmp/android_cross.txt
|
|
sudo ninja -C build install
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: result_x86_64
|
|
path: build/src/libthorvg*
|
|
|
|
build_aarch64:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: nttld/setup-ndk@v1.3.1
|
|
id: setup-ndk
|
|
with:
|
|
submodules: true
|
|
ndk-version: r21e
|
|
local-cache: true
|
|
|
|
- name: Install Packages
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install meson ninja-build libgles-dev
|
|
|
|
- name: Build
|
|
env:
|
|
NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
API: 21
|
|
run: |
|
|
sed -e "s|NDK|$NDK|g" -e "s|HOST_TAG|linux-x86_64|g" -e "s|API|$API|g" ./cross/android_aarch64.txt > /tmp/android_cross.txt
|
|
meson setup build -Dlog=true -Dengines=all -Dloaders=all -Dsavers=all -Dbindings=capi -Dstatic=true --cross-file /tmp/android_cross.txt
|
|
sudo ninja -C build install
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: result_aarch64
|
|
path: build/src/libthorvg*
|