Skip to content

Commit

Permalink
编写自动构建脚本:Nelement GithubWorkflow 1.0。删除不必要的workflow。
Browse files Browse the repository at this point in the history
  • Loading branch information
Neboer committed Feb 12, 2023
1 parent 4f0f451 commit afc7636
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 1,275 deletions.
73 changes: 13 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,35 @@ name: APK Build
on:
pull_request: { }
push:
branches: [ main, develop ]
branches: [ main ]

# Enrich gradle.properties for CI/CD
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon

jobs:
debug:
name: Build debug APKs (${{ matrix.target }})
release:
name: Build release APKs (Fdroid)
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
strategy:
fail-fast: false
matrix:
target: [ Gplay, Fdroid ]
# Allow all jobs on develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}-{1}', matrix.target, github.sha) || format('build-debug-{0}-{1}', matrix.target, github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- name: Configure gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Assemble ${{ matrix.target }} debug apk
run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES
- name: Upload ${{ matrix.target }} debug APKs
uses: actions/upload-artifact@v3
- uses: actions/cache@v3
with:
name: vector-${{ matrix.target }}-debug
path: |
vector-app/build/outputs/apk/*/debug/*.apk
release:
name: Build unsigned GPlay APKs
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref == 'refs/head/main' && format('build-release-apk-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('build-release-apk-develop-{0}', github.sha) || format('build-debug-{0}', github.ref) }}
cancel-in-progress: ${{ github.ref != 'refs/head/main' }}
steps:
- uses: actions/checkout@v3
- name: Configure gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Assemble GPlay unsigned apk
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload Gplay unsigned APKs
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Assemble Fdroid release apk
run: ./gradlew :vector-app:assembleFdroidRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload Fdroid release APKs
uses: actions/upload-artifact@v3
with:
name: vector-gplay-release-unsigned
name: vector-Fdroid-release
path: |
vector-app/build/outputs/apk/*/release/*.apk
exodus:
runs-on: ubuntu-latest
needs: release
steps:
- name: Obtain apk from artifact
id: download
uses: actions/download-artifact@v3
with:
name: vector-gplay-release-unsigned
- name: Show apks in artifact
run: ls -R ${{steps.download.outputs.download-path}}
- name: Execute exodus-standalone
uses: docker://exodusprivacy/exodus-standalone:latest
with:
args: /github/workspace/gplay/release/vector-gplay-universal-release-unsigned.apk -j -o /github/workspace/exodus.json
- name: Upload exodus json report
uses: actions/upload-artifact@v3
with:
name: exodus.json
path: |
exodus.json
- name: Check for trackers
run: "jq -e '.trackers == []' exodus.json > /dev/null || { echo '::error static analysis identified user tracking library' ; exit 1; }"
20 changes: 0 additions & 20 deletions .github/workflows/danger.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/docs.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/nightly.yml

This file was deleted.

102 changes: 0 additions & 102 deletions .github/workflows/post-pr.yml

This file was deleted.

94 changes: 0 additions & 94 deletions .github/workflows/quality.yml

This file was deleted.

Loading

0 comments on commit afc7636

Please sign in to comment.