diff --git a/.github/workflows/on_tag_workflow.yml b/.github/workflows/on_tag_workflow.yml index 9d9f6aa2..d354337c 100644 --- a/.github/workflows/on_tag_workflow.yml +++ b/.github/workflows/on_tag_workflow.yml @@ -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/create-json@1.1.2 + with: + name: google-play-services.json + json: ${{ secrets.GOOGLE_PLAY_STORE_SEVICE_ACCOUNT_JSON }} + + - name: Playstore upload + uses: r0adkll/upload-google-play@v1.1.3 + 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 @@ -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 @@ -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