Skip to content

Update build.gradle.kts #6

Update build.gradle.kts

Update build.gradle.kts #6

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 1
- name: Validate Dependencies Lock File
run: |
if [ ! -f package-lock.json ] && [ ! -f yarn.lock ]; then
echo "Error: Dependencies lock file is not found in the repository root."
exit 1
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm install
- name: Release Using Semantic-Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
run: npm exec semantic-release
- name: Cache Gradle Files
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew generatePatchesFiles clean --parallel
- name: Trigger APK Build
run: |
curl -X POST https://api.github.com/repos/crimera/piko-builds/dispatches \
-H 'Accept: application/vnd.github+json' \
-H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" \
-d '{"event_type": "build"}'