Skip to content

Commit

Permalink
fix: added publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram Kalta authored and Vikram Kalta committed Apr 3, 2024
1 parent 99aa09a commit 3b8d4d8
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup local.properties
run: |
cat << EOF >> local.properties
sdk.dir=$ANDROID_HOME
host="${{ secrets.HOST }}"
APIKey="${{ secrets.API_KEY }}"
deliveryToken="${{ secrets.DELIVERY_TOKEN }}"
environment="${{ secrets.ENVIRONMENT }}"
contentType="${{ secrets.CONTENT_TYPE }}"
assetUid="${{ secrets.ASSET_UID }}"
EOF
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish - Release

on:
release:
types: [released]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Setup local.properties
run: |
cat << EOF >> local.properties
sdk.dir=$ANDROID_HOME
host="${{ secrets.HOST }}"
APIKey="${{ secrets.API_KEY }}"
deliveryToken="${{ secrets.DELIVERY_TOKEN }}"
environment="${{ secrets.ENVIRONMENT }}"
contentType="${{ secrets.CONTENT_TYPE }}"
assetUid="${{ secrets.ASSET_UID }}"
EOF
- name: Gradle build and clean
run: |
./gradlew clean build
- name: Publish the SDK
run: |
./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
44 changes: 44 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish - Snapshot

on:
push:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Check whether the version is a snapshot
run: |
if grep -q "\-SNAPSHOT" ./contentstack/build.gradle
then
:
else
exit 1
fi
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Setup local.properties
run: |
cat << EOF >> local.properties
sdk.dir=$ANDROID_HOME
host="${{ secrets.HOST }}"
APIKey="${{ secrets.API_KEY }}"
deliveryToken="${{ secrets.DELIVERY_TOKEN }}"
environment="${{ secrets.ENVIRONMENT }}"
contentType="${{ secrets.CONTENT_TYPE }}"
assetUid="${{ secrets.ASSET_UID }}"
EOF
- name: Build the SDK - Snapshot
run: |
./gradlew clean build
- name: Publish the SDK - Snapshot
run: |
./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }}
11 changes: 11 additions & 0 deletions .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup local.properties
run: |
cat << EOF >> local.properties
sdk.dir=$ANDROID_HOME
host="${{ secrets.HOST }}"
APIKey="${{ secrets.API_KEY }}"
deliveryToken="${{ secrets.DELIVERY_TOKEN }}"
environment="${{ secrets.ENVIRONMENT }}"
contentType="${{ secrets.CONTENT_TYPE }}"
assetUid="${{ secrets.ASSET_UID }}"
EOF
- uses: snyk/actions/setup@master
- run: snyk test
env:
Expand Down

0 comments on commit 3b8d4d8

Please sign in to comment.