Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added publish workflow #50

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
46 changes: 46 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish - Snapshot

on:
push:
branches:
- master

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
Loading