Skip to content

Update gradle/actions action to v3.3.1 (#12) #25

Update gradle/actions action to v3.3.1 (#12)

Update gradle/actions action to v3.3.1 (#12) #25

Workflow file for this run

name: Release
on:
push:
branches:
- main
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
java-version: 17
distribution: adopt
- name: Set up gradle
uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1
# TODO: Run instrumental tests
- name: Build sample app
run: ./gradlew spotlessCheck assembleDebug
# Release for commits with tags
- name: Get tag name
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'dewantawsif/flexible-hilt'
run: |
set -x
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Publish release
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'dewantawsif/flexible-hilt'
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache -P version=${RELEASE_TAG:1}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
RELEASE_TAG: ${{ env.VERSION_TAG }}