Merge pull request #5 from eu-digital-identity-wallet/feature/batch-i… #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Release and add tag | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| jobs: | |
| build-release: | |
| runs-on: github-runner-dune | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Copy CI gradle.properties | |
| run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Setup Android SDK | |
| uses: amyu/setup-android@v4 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| gradle-version: wrapper | |
| cache-read-only: false | |
| - name: Run lint check | |
| run: ./gradlew lint | |
| - name: Run unit tests | |
| run: ./gradlew testDemoDebugUnitTest | |
| - name: Build DEMO debug APK | |
| run: ./gradlew assembleDemoDebug | |
| - name: Generate Next Tag with version | |
| run: | | |
| chmod +x ./.github/workflows/generate_next_tag.sh | |
| NEXT_TAG=$(./.github/workflows/generate_next_tag.sh) | |
| echo "Next tag: $NEXT_TAG" | |
| echo "TAG_NAME=$NEXT_TAG" >> $GITHUB_ENV | |
| - name: Create Tag | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git tag $TAG_NAME | |
| git push origin $TAG_NAME | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| release_name: Release ${{ env.TAG_NAME }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload APK to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: app/build/outputs/apk/demo/debug/app-demo-debug.apk | |
| asset_name: app-demo-debug.apk | |
| asset_content_type: application/vnd.android.package-archive | |