Skip to content

Update gradle/actions action to v3.4.1 #2455

Update gradle/actions action to v3.4.1

Update gradle/actions action to v3.4.1 #2455

Workflow file for this run

name: Publish
on:
push:
paths-ignore:
- '.idea/**'
- '.gitattributes'
- '.github/**.json'
- '.gitignore'
- '.gitmodules'
- '**.md'
- 'LICENSE'
- 'NOTICE'
- '.github/workflows/tasks.yml'
- '.github/workflows/code_quality.yml'
- '.github/workflows/nightly-merge.yml'
- 'source/**'
- 'qodana.yaml'
pull_request:
paths-ignore:
- '.idea/**'
- '.gitattributes'
- '.github/**.json'
- '.gitignore'
- '.gitmodules'
- '**.md'
- 'LICENSE'
- 'NOTICE'
- '.github/workflows/tasks.yml'
- '.github/workflows/code_quality.yml'
- '.github/workflows/nightly-merge.yml'
- 'source/**'
- 'qodana.yaml'
env:
BUGLY_APPID: ${{ secrets.BUGLY_APPID }}
permissions:
contents: write
jobs:
check:
name: Check
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: Check
run: ./gradlew lintKotlinMain --warning-mode all
submit_dep_gragh:
name: Submit dependency gragh
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Gradle cache and set up
uses: gradle/actions/[email protected]
with:
dependency-graph: generate-and-submit
- run: ./gradlew assembleRelease
build_debug:
name: Build_Debug
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') }}
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Gradle cache
uses: gradle/actions/[email protected]
- run: ./gradlew assembleDebug
- name: Sign apk release
id: signStep
uses: ilharp/sign-android-release@nightly
with:
releaseDir: app/build/outputs/apk/debug
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASS }}
keyPassword: ${{ secrets.KEY_PASS }}
buildToolsVersion: 33.0.0
- name: Upload signed apk
uses: actions/[email protected]
with:
name: signed_debug_apk
path: ${{ steps.signStep.outputs.signedFile }}
test_debug:
name: Test_Debug
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Gradle cache
uses: gradle/actions/[email protected]
- run: ./gradlew testDebugUnitTest --warning-mode all
build_release:
name: Build_Release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Gradle cache
uses: gradle/actions/[email protected]
- run: ./gradlew assembleRelease
- name: Upload mapping to Bugly
uses: qhy040404/[email protected]
with:
appid: ${{ secrets.BUGLY_APPID }}
appkey: ${{ secrets.BUGLY_APPKEY }}
bundleid: 'com.qhy040404.libraryonetap'
version: ${{ github.ref_name }}
platform: 'Android'
inputMapping: 'app/build/outputs/mapping/release'
- name: Rename unsigned apk
run: |
sudo apt-get install rename -y
rename 's/-unsigned.apk/.apk/' app/build/outputs/apk/release/*
- name: Sign apk release
id: signStep
uses: ilharp/sign-android-release@nightly
with:
releaseDir: app/build/outputs/apk/release
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_PASS }}
keyPassword: ${{ secrets.KEY_PASS }}
buildToolsVersion: 33.0.0
- name: Upload signed apk
uses: actions/[email protected]
with:
name: signed_release_apk
path: ${{ steps.signStep.outputs.signedFile }}
test_release:
name: Test_Release
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Gradle cache
uses: gradle/actions/[email protected]
- run: ./gradlew testReleaseUnitTest --warning-mode all
pre-release:
name: Pre-release
if: ${{ contains(github.ref, 'Pre') }}
needs: [ build_release, test_release ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download signed release apk
uses: actions/[email protected]
with:
name: signed_release_apk
path: upload
- name: Rename pre-release apk
run: |
sudo apt-get install rename -y
rename 's/-release-signed.apk/-Pre-release-signed.apk/' upload/*
- name: Generate SHA-512 checksums
shell: sh
run: |
set -eu
(
cd "upload"
sha512sum *.apk > SHA512SUMS
)
- name: Upload SHA512SUMS
continue-on-error: true
uses: actions/[email protected]
with:
name: SHA512SUMS
path: upload/SHA512SUMS
- name: Generate release body
continue-on-error: true
uses: qhy040404/[email protected]
with:
changelog: 'Changelog.md'
template: '.github/RELEASE_TEMPLATE.md'
tag: ${{ github.ref_name }}
template-data: '* This is automated GitHub deployment, human-readable changelog should be available soon.'
fore-delimiter: ${{ github.ref_name }}
back-delimiter: '---'
- name: Create Github release
id: github_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.QHYBOT_RELEASE_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: v${{ github.ref }}
body_path: .github/RELEASE_TEMPLATE.md
prerelease: true
files: |
upload/Library-One-Tap_v${{ github.ref_name }}-release-signed.apk
upload/SHA512SUMS
release:
name: Release
if: ${{ !contains(github.ref, 'Pre') }}
needs: [ build_release, test_release ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download signed release apk
uses: actions/[email protected]
with:
name: signed_release_apk
path: upload
- name: Generate SHA-512 checksums
shell: sh
run: |
set -eu
(
cd "upload"
sha512sum *.apk > SHA512SUMS
)
- name: Upload SHA512SUMS
continue-on-error: true
uses: actions/[email protected]
with:
name: SHA512SUMS
path: upload/SHA512SUMS
- name: Generate release body
continue-on-error: true
uses: qhy040404/[email protected]
with:
changelog: 'Changelog.md'
template: '.github/RELEASE_TEMPLATE.md'
tag: ${{ github.ref_name }}
template-data: '* This is automated GitHub deployment, human-readable changelog should be available soon.'
fore-delimiter: ${{ github.ref_name }}
back-delimiter: '---'
- name: Create Github release
id: github_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.QHYBOT_RELEASE_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: v${{ github.ref }}
body_path: .github/RELEASE_TEMPLATE.md
prerelease: false
files: |
upload/Library-One-Tap_v${{ github.ref_name }}-release-signed.apk
upload/SHA512SUMS