TP-12345 | actions setup
This commit is contained in:
30
.github/workflows/master_pull_request.yml
vendored
Normal file
30
.github/workflows/master_pull_request.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Master pull request CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-qa-debug:
|
||||
runs-on: [ default ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Log Build Metadata
|
||||
run: |
|
||||
echo "Commit SHA: ${{ github.sha }}"
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Assemble with Stacktrace
|
||||
run: ./gradlew assembleDebug --stacktrace
|
||||
32
.github/workflows/master_push.yml
vendored
Normal file
32
.github/workflows/master_push.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Master push CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-qa-debug:
|
||||
runs-on: [ default ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Log Build Metadata
|
||||
run: |
|
||||
echo "Commit SHA: ${{ github.sha }}"
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Assemble with Stacktrace
|
||||
run: ./gradlew assembleRelease --stacktrace
|
||||
- name: Upload to nexus
|
||||
run: ./gradlew publish -PIS_SNAPSHOT=false -PNEXUS_URL=https://nexus.cmd.navi-tech.in/repository/maven-releases -PNEXUS_USERNAME=${{ secrets.NEXUS_USERNAME }} -PNEXUS_PASSWORD=${{ secrets.NEXUS_PASSWORD }}
|
||||
31
.github/workflows/publish_aar.yml
vendored
Normal file
31
.github/workflows/publish_aar.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Publish AAR CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-qa-debug:
|
||||
runs-on: [ default ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Log Build Metadata
|
||||
run: |
|
||||
echo "Commit SHA: ${{ github.sha }}"
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Assemble with Stacktrace
|
||||
run: ./gradlew :navi-alfred:assembleRelease --stacktrace
|
||||
- name: Upload to nexus
|
||||
run: ./gradlew publish -PIS_SNAPSHOT=true -PNEXUS_URL=https://nexus.cmd.navi-tech.in/repository/maven-snapshots -PNEXUS_USERNAME=${{ secrets.NEXUS_USERNAME }} -PNEXUS_PASSWORD=${{ secrets.NEXUS_PASSWORD }}
|
||||
@@ -37,6 +37,48 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
if (project.hasProperty('NEXUS_URL')) {
|
||||
maven {
|
||||
url = "$NEXUS_URL"
|
||||
credentials {
|
||||
username = "$NEXUS_USERNAME"
|
||||
password = "$NEXUS_PASSWORD"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
publications {
|
||||
if (project.hasProperty('NEXUS_URL')) {
|
||||
maven(MavenPublication) {
|
||||
artifactId = "alfred"
|
||||
groupId = "com.navi.medici"
|
||||
|
||||
if ("$IS_SNAPSHOT" == "false") {
|
||||
version = "$VERSION_NAME"
|
||||
println("https://nexus.cmd.navi-tech.in/#browse/browse:maven-releases:com%2Fnavi%2Fmedici%2Falfred%2F$version")
|
||||
} else {
|
||||
version = "$VERSION_NAME-SNAPSHOT"
|
||||
println("https://nexus.cmd.navi-tech.in/#browse/browse:maven-snapshots:com%2Fnavi%2Fmedici%2Falfred%2F$version")
|
||||
}
|
||||
|
||||
artifact("build/outputs/aar/navi-alfred-release.aar")
|
||||
|
||||
pom.withXml {
|
||||
def dependenciesNode = asNode().appendNode('dependencies')
|
||||
configurations.implementation.allDependencies.each {
|
||||
def dependencyNode = dependenciesNode.appendNode('dependency')
|
||||
dependencyNode.appendNode('groupId', it.group)
|
||||
dependencyNode.appendNode('artifactId', it.name)
|
||||
dependencyNode.appendNode('version', it.version)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||
implementation 'androidx.core:core-ktx:1.8.0'
|
||||
|
||||
Reference in New Issue
Block a user