Skip to content

Commit

Permalink
CI change
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterBin committed Jun 3, 2024
1 parent a012369 commit 3fe6379
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 238 deletions.
16 changes: 0 additions & 16 deletions .github/DISCUSSION_TEMPLATE/questions.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/bug.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/documentation-error.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/build-debug-apk.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Build debug APK
on:
push:
pull_request:
jobs:
build-debug-apk:
Expand All @@ -17,3 +16,7 @@ jobs:
with:
name: Debug APK
path: sample/build/outputs/apk/debug/**.apk
- uses: actions/upload-artifact@v4
with:
name: Debug Tangem Demo APK
path: tangem-demo/build/outputs/apk/debug/**.apk
16 changes: 0 additions & 16 deletions .github/workflows/check-formatting.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/neutral-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Neutral Build

on:
push:
branches:
- 'tangem-master'
workflow_dispatch:

env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DVELOPMENT_ANDROID }}

jobs:
tag:
name: Create tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: vico

- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu

- uses: gradle/gradle-build-action@v3
- run: |
VERSION_NAME=$(grep -oP "(?<=version_name).*(?=\",)" versions.gradle | grep -oP "(?<=\").*")
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "TAG_NAME=v$VERSION_NAME" >> $GITHUB_ENV
./gradlew assembleDebug
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ env.VERSION_NAME }}",
sha: context.sha
})
- name: Build and publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: |
echo sdk.dir = $ANDROID_HOME > local.properties
./gradlew -PgithubUser=${{ secrets.GITHUB_ACTOR }} -PgithubPass=${{ secrets.GITHUB_TOKEN }} -PartifactVersion=${{ env.VERSION_NAME }} publish
- name: Build notification
if: always()
uses: adamkdean/simple-slack-notify@master
with:
channel: '#development-android'
status: ${{ job.status }}
success_text: 'Tangem Vico library build (${{ env.VERSION_NAME }}) has been created and uploaded to Nexus.'
failure_text: 'GitHub Action #${{ github.run_number }} failed. Tag has not been not created.'
cancelled_text: 'GitHub Action #${{ github.run_number }} was cancelled'
fields: |
[{"title": "TAG", "value": "${{ env.VERSION_NAME }}"},
{"title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}]
56 changes: 0 additions & 56 deletions .github/workflows/release-update.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Run tests
on:
push:
pull_request:
jobs:
run-tests:
Expand All @@ -16,11 +15,3 @@ jobs:
- run: chmod +x gradlew
- id: unit-tests
run: ./gradlew vico:core:testDebug
- id: paparazzi
if: ${{ success() || steps.unit-tests.conclusion == 'failure' }}
run: ./gradlew sample:verifyPaparazziDebug
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && steps.paparazzi.conclusion == 'failure' }}
with:
name: Paparazzi deltas
path: sample/build/paparazzi/failures/delta-*.png
84 changes: 8 additions & 76 deletions common-scripts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ String getArtifactId(Project project) {

void customizePom(MavenPom pom) {

pom.name = "Vico"
pom.name = "Tangem Vico"
pom.description = "A light and extensible chart library for Android."
pom.url = "https://github.com/patrykandpatrick/vico"
pom.url = "https://github.com/tangem/vico"

pom.licenses {

Expand All @@ -77,25 +77,10 @@ void customizePom(MavenPom pom) {
}

pom.scm {
connection = "scm:git:git://github.com/patrykandpatrick/vico.git"
developerConnection = "scm:git:ssh://github.com/patrykandpatrick/vico.git"
connection = "scm:git:git://github.com/tangem/vico.git"
developerConnection = "scm:git:ssh://github.com/tangem/vico.git"
url = "https://github.com/patrykandpatrick/vico"
}

pom.developers {

developer {
id = "patrykgoworowski"
name = "Patryk Goworowski"
email = "contact@patrykgoworowski.pl"
}

developer {
id = "patrickmichalik"
name = "Patrick Michalik"
email = "contact@patrickmichalik.com"
}
}
}

boolean isReleaseVersion() {
Expand All @@ -104,68 +89,15 @@ boolean isReleaseVersion() {

void setUpRepositories(RepositoryHandler handler) {
handler.maven {
def releaseUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion() ? releaseUrl : snapshotUrl

name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/tangem/vico")
credentials {
username = "patrykandpatrick"
password = findProperty("OSSRH_PASSWORD")
username = "$githubUser"
password = "$githubPass"
}
}
}

void setUpSigning(SigningExtension signing, MavenPublication publication) {
signing.setRequired {
isReleaseVersion() && gradle.taskGraph.allTasks.any { it.is(PublishToMavenRepository) }
}

def gpgKey = findProperty("GPG_KEY")
def gpgKeyPassword = findProperty("GPG_KEY_PASSWORD")

signing.useInMemoryPgpKeys(gpgKey, gpgKeyPassword)
signing.sign publication
}

//apply from: '../artifactConfig.gradle'
//apply plugin: 'maven-publish'
//
//afterEvaluate {
// publishing {
// publications {
// maven(MavenPublication) {
// groupId = "$artifactConfig.group"
// artifactId = "$project.artifactId"
// version = "$artifactConfig.version"
//
// if (artifactId == "android") {
// from components.release
// artifact(sourceJar)
//
// pom.withXml {
// Node pomNode = asNode()
// pomNode.dependencies.'*'.findAll() {
// it.groupId.text() == artifactConfig.group
// }.each() { it.parent().remove(it) }
//
// pomNode.dependencies.'*'.findAll() {
// it.scope.text() == 'runtime'
// }.each { it.scope*.value = 'compile' }
// }
// } else if (artifactId == "core") {
// from components.java
// }
// }
// }
// repositories {
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/tangem/tangem-sdk-android")
// credentials {
// username = "$githubUser"
// password = "$githubPass"
// }
// }
// }
// }
//}
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ android.useAndroidX=true
kotlin.code.style=official
# https://blog.jetbrains.com/kotlin/2022/07/a-new-approach-to-incremental-compilation-in-kotlin/
kotlin.incremental.useClasspathSnapshot=true

githubUser=github_user
githubPass=github_pass
2 changes: 1 addition & 1 deletion versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ext {

library = [
groupId : "com.patrykandpatrick.vico",
version_name : "2.0.0-alpha.21",
version_name : "2.0.0-alpha.21-tangem1",
version_code : 1,
target_sdk : 34,
min_sdk : 19,
Expand Down

0 comments on commit 3fe6379

Please sign in to comment.