Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-kerem committed Dec 10, 2024
1 parent dbbd322 commit 20ac367
Showing 1 changed file with 19 additions and 36 deletions.
55 changes: 19 additions & 36 deletions .github/workflows/espresso-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ on:
- 'minor'
- 'patch'

pull_request:
branches:
- main

defaults:
run:
working-directory: visual-espresso
Expand All @@ -25,17 +21,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: espresso-release

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh
# gpg-private-key: ${{ secrets.MVN_CENTRAL_GPG_PRIVATE_KEY }}
# gpg-passphrase: ${{ secrets.MVN_CENTRAL_GPG_PASSPHRASE }}

- name: Set up Git
if: ${{ steps.prep.outputs.tag_name == '' }}
Expand All @@ -49,42 +41,33 @@ jobs:
- name: Bump version
id: upgrade
run: |
new_version=$(./gradlew -q bumpVersion -PreleaseType=patch)
new_version=$(./gradlew -q bumpVersion -PreleaseType=${{ github.event.inputs.releaseType }})
echo "version=$new_version" >> "$GITHUB_OUTPUT"
- name: Publish artifact
run: ./gradlew publishToMavenCentral --no-configuration-cache
- name: Build, publish and release artifact
run: ./gradlew build publishAndReleaseToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MVN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MVN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MVN_CENTRAL_GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MVN_CENTRAL_GPG_PASSPHRASE }}

- name: Check if .aar is created
- name: Push new version to Git
id: push_to_git
run: |
if [ -f visual-espresso/visual/build/outputs/aar/visual-release.aar ]; then
echo "File exists!"
else
echo "File does not exist."
exit 1
fi
tag_name="espresso-${{ steps.upgrade.outputs.version }}"
git add ./build.gradle
git commit -m "[release] $tag_name"
git tag $tag_name
git push
git push origin $tag_name
#- name: Push new version to Git
# id: push_to_git
# run: |
# tag_name="espresso-${{ steps.upgrade.outputs.version }}"
# git add ./build.gradle
# git commit -m "[release] $tag_name"
# git tag $tag_name
# git push
# git push origin $tag_name
echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT"
# echo "tag_name=$tag_name" >> "$GITHUB_OUTPUT"

#- name: Github Release
# uses: softprops/action-gh-release@v2
# with:
# fail_on_unmatched_files: true
# tag_name: ${{ steps.push_to_git.outputs.tag_name }}
# files: visual-espresso/visual/build/outputs/aar/visual-release.aar
# generate_release_notes: true
- name: Github Release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
tag_name: ${{ steps.push_to_git.outputs.tag_name }}
files: visual-espresso/visual/build/outputs/aar/visual-release.aar
generate_release_notes: true

0 comments on commit 20ac367

Please sign in to comment.