Skip to content

Commit

Permalink
chore(build): refactor on_tag_workflow
Browse files Browse the repository at this point in the history
SUITEDEV-35510

Co-authored-by: megamegax <[email protected]>
Co-authored-by: Andras Sarro <[email protected]>
  • Loading branch information
3 people committed Apr 8, 2024
1 parent 8d67dd2 commit 71cc2eb
Showing 1 changed file with 75 additions and 3 deletions.
78 changes: 75 additions & 3 deletions .github/workflows/on_tag_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,82 @@ jobs:
- name: Release with Gradle
run: make release

CreateSampleReleaseBundle:
name: Create release bundle from sample app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"
- name: set up JDK 1.17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Prepare CI
run: make prepare-ci

- name: Prepare sample release
run: make prepare-sample-release

- name: Create sample app release bundle
run: make create-sample-release-bundle

- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: mobile-sdk-sample
path: sample/build/outputs/bundle/release/sample-release.aab

ReleaseSample:
name: Release sample app
runs-on: ubuntu-latest
needs: [Release, CreateSampleReleaseBundle]
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # 0 indicates all history
- run: git fetch --all || echo "==> Accept any result"

- name: Download sample app
uses: actions/download-artifact@v4
with:
name: mobile-sdk-sample

- name: create-google services json
uses: jsdaniell/[email protected]
with:
name: google-play-services.json
json: ${{ secrets.GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON }}

- name: Playstore upload
uses: r0adkll/[email protected]
with:
serviceAccountJson: google-play-services.json
packageName: com.emarsys.sample
releaseFiles: sample-release.aab

- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create Release Page
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ github.ref }}
body_path: changelog.md
draft: false
prerelease: false

SlackNotification:
name: Send slack notification
runs-on: ubuntu-latest
needs: [Release]
needs: [ReleaseSample]
steps:
- name: setup RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
Expand Down Expand Up @@ -106,7 +178,7 @@ jobs:
CreateJiraTicket:
name: Create Jira ticket
runs-on: ubuntu-latest
needs: [Release]
needs: [ReleaseSample]
steps:
- name: Login to Jira
uses: atlassian/gajira-login@master
Expand All @@ -130,7 +202,7 @@ jobs:
OnError:
name: Handle on Error
runs-on: ubuntu-latest
needs: [Release]
needs: [ReleaseSample]
if: ${{ failure() }}
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit 71cc2eb

Please sign in to comment.