Add New APK Only Pipeline
- Automatically sync downstream if build succeeds on a commit to master - Downstream build APK only and publish as a release - Use deterministic name for programmatic access
This commit is contained in:
@@ -0,0 +1,129 @@
|
|||||||
|
name: Release APK Only
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "master" ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_TYPE: RelWithDebInfo
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-android-only:
|
||||||
|
name: Android
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
if: ${{ vars.APK_ONLY != '' }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
hmd: ['Standard']
|
||||||
|
buildtype: ['Release', 'Debug', 'DebugWithValidationLayer']
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: set up JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: gradle
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: >
|
||||||
|
sudo apt-get update && sudo apt-get install glslang-tools librsvg2-bin gettext
|
||||||
|
|
||||||
|
- name: Check for Secret availability
|
||||||
|
id: secret-check
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ secrets.APK_SIGNINGKEYPASSWORD }}" != '' && "${{ secrets.APK_KEYSTORE_BASE64 }}" != '' ]]; then
|
||||||
|
echo "available=true" >> $GITHUB_OUTPUT;
|
||||||
|
else
|
||||||
|
echo "available=false" >> $GITHUB_OUTPUT;
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Secrets
|
||||||
|
if: ${{ github.event_name != 'pull_request' && steps.secret-check.outputs.available == 'true' }}
|
||||||
|
env:
|
||||||
|
APK_SIGNINGKEYPASSWORD: ${{ secrets.APK_SIGNINGKEYPASSWORD }}
|
||||||
|
APK_KEYSTORE_BASE64: ${{ secrets.APK_KEYSTORE_BASE64 }}
|
||||||
|
run: |
|
||||||
|
echo signingKeyPassword="$APK_SIGNINGKEYPASSWORD" > gradle.properties
|
||||||
|
echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
chmod +x gradlew
|
||||||
|
./gradlew assemble${{ matrix.hmd }}${{ matrix.buildtype }}
|
||||||
|
|
||||||
|
- name: Prepare before archiving artifacts
|
||||||
|
run: |
|
||||||
|
mkdir apk
|
||||||
|
mv $(find build/outputs/apk/ -name "*.apk") apk/
|
||||||
|
mkdir debug
|
||||||
|
mv build/intermediates/merged_native_libs/*/out/lib/* debug/
|
||||||
|
find debug -name libopenxr_loader.so -delete
|
||||||
|
|
||||||
|
- name: Archive APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: apk-${{ matrix.hmd }}-${{ (github.event_name == 'pull_request' && matrix.buildtype == 'Release') && 'Release-unsigned' || matrix.buildtype }}
|
||||||
|
path: apk/*.apk
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
- name: Archive debug symbols
|
||||||
|
if: ${{ matrix.buildtype != 'Release' }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: symbols-${{ matrix.hmd }}-${{ matrix.buildtype }}
|
||||||
|
path: debug/**/*.so
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Create APK release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-android-only
|
||||||
|
if: ${{ vars.APK_ONLY != '' }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download APK artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: apk
|
||||||
|
pattern: 'apk-*'
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Rename APK artifacts
|
||||||
|
run: |
|
||||||
|
cd apk
|
||||||
|
for f in *.apk; do
|
||||||
|
BASENAME=`echo ${f}|awk -F '-apk-' '{print $2}'`
|
||||||
|
mv "${f}" "org.meumeu.wivrn-${BASENAME}"
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Download APK debug artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: symbols
|
||||||
|
pattern: 'symbols-*'
|
||||||
|
merge-multiple: false
|
||||||
|
|
||||||
|
- name: Zip APK debug artifacts
|
||||||
|
run: |
|
||||||
|
cd symbols
|
||||||
|
zip -r ../debug-symbols.zip .
|
||||||
|
|
||||||
|
- name: APK Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.DOWNSTREAM_GITHUB_TOKEN }}
|
||||||
|
tag_name: "apk-${{ github.sha }}"
|
||||||
|
generate_release_notes: true
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
fail_on_unmatched_files: true
|
||||||
|
files: |
|
||||||
|
apk/*.apk
|
||||||
|
debug-symbols.zip
|
||||||
@@ -16,6 +16,7 @@ jobs:
|
|||||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -77,6 +78,7 @@ jobs:
|
|||||||
build-server-flatpak:
|
build-server-flatpak:
|
||||||
name: Linux server (flatpak)
|
name: Linux server (flatpak)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
container:
|
container:
|
||||||
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
|
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
|
||||||
options: --privileged
|
options: --privileged
|
||||||
@@ -102,6 +104,7 @@ jobs:
|
|||||||
build-test-client:
|
build-test-client:
|
||||||
name: Linux client
|
name: Linux client
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -135,6 +138,7 @@ jobs:
|
|||||||
build-dissector:
|
build-dissector:
|
||||||
name: Wireshark dissector
|
name: Wireshark dissector
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -169,6 +173,7 @@ jobs:
|
|||||||
build-android:
|
build-android:
|
||||||
name: Android
|
name: Android
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -228,6 +233,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: apk-${{ matrix.hmd }}-${{ (github.event_name == 'pull_request' && matrix.buildtype == 'Release') && 'Release-unsigned' || matrix.buildtype }}
|
name: apk-${{ matrix.hmd }}-${{ (github.event_name == 'pull_request' && matrix.buildtype == 'Release') && 'Release-unsigned' || matrix.buildtype }}
|
||||||
path: apk/*.apk
|
path: apk/*.apk
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
- name: Archive debug symbols
|
- name: Archive debug symbols
|
||||||
if: ${{ matrix.buildtype != 'Release' }}
|
if: ${{ matrix.buildtype != 'Release' }}
|
||||||
@@ -235,12 +241,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: symbols-${{ matrix.hmd }}-${{ matrix.buildtype }}
|
name: symbols-${{ matrix.hmd }}-${{ matrix.buildtype }}
|
||||||
path: debug/**/*.so
|
path: debug/**/*.so
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create release
|
name: Create release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
needs: [build-server, build-android, build-test-client, build-dissector, build-server-flatpak]
|
||||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||||
needs: [build-android, build-server-flatpak]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts (APK)
|
- name: Download artifacts (APK)
|
||||||
@@ -257,7 +264,7 @@ jobs:
|
|||||||
path: flatpak
|
path: flatpak
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ inputs.ref }}
|
tag_name: ${{ inputs.ref }}
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
@@ -265,3 +272,26 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
apk/*.apk
|
apk/*.apk
|
||||||
flatpak/*.flatpak
|
flatpak/*.flatpak
|
||||||
|
|
||||||
|
sync_fork_downstream:
|
||||||
|
name: Sync fork downstream
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build-server, build-android]
|
||||||
|
if: ${{ vars.APK_ONLY == '' }} && github.branch == 'master'
|
||||||
|
steps:
|
||||||
|
- name: Check for DOWNSTREAM_GITHUB_TOKEN
|
||||||
|
id: downstream-secret-check
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ secrets.DOWNSTREAM_GITHUB_TOKEN }}" != '' ]]; then
|
||||||
|
echo "available=true" >> $GITHUB_OUTPUT;
|
||||||
|
else
|
||||||
|
echo "available=false" >> $GITHUB_OUTPUT;
|
||||||
|
fi
|
||||||
|
- name: Sync fork downstream
|
||||||
|
if: ${{ steps.downstream-secret-check.outputs.available == 'true' }}
|
||||||
|
run: |
|
||||||
|
curl -X POST -H "Accept: application/vnd.github.v3+json" \
|
||||||
|
-H "Authorization: token ${{ secrets.DOWNSTREAM_GITHUB_TOKEN }}" \
|
||||||
|
https://api.github.com/repos/WiVRn/WiVRn-APK/merge-upstream \
|
||||||
|
-d '{"branch":"master"}'
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ jobs:
|
|||||||
formatting-check:
|
formatting-check:
|
||||||
name: Formatting check
|
name: Formatting check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ jobs:
|
|||||||
locale-check:
|
locale-check:
|
||||||
name: Locale check
|
name: Locale check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ vars.APK_ONLY == '' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user