From 1fb17bed14d04265d9f81b130b1764425f5f6ef8 Mon Sep 17 00:00:00 2001 From: Kazik Pogoda Date: Thu, 29 Aug 2024 21:53:35 +0200 Subject: [PATCH] fix: env variables in github actions --- .github/workflows/build-release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 81e3b3f..3816e69 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -31,7 +31,6 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Build - run: ./gradlew -Pversion=${VERSION} build sourcesJar javadocJar publishToSonatype closeAndReleaseSonatypeStagingRepository env: ORG_GRADLE_PROJECT_githubActor: ${{ secrets.GITHUBACTOR }} ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUBTOKEN }} @@ -39,11 +38,14 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} ORG_GRADLE_PROJECT_sonatypeUser: ${{ secrets.SONATYPE_USER }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} + run: ./gradlew -Pversion=$VERSION build sourcesJar javadocJar publishToSonatype closeAndReleaseSonatypeStagingRepository - name: Find branch from tag id: find-branch + env: + TAG_NAME: ${{ github.event.release.tag_name }} run: | - BRANCH=$(git branch -r --contains ${{ github.event.release.tag_name }} | grep -v '\->' | sed 's/origin\///' | head -n 1) + BRANCH=$(git branch -r --contains $TAG_NAME | grep -v '\->' | sed 's/origin\///' | head -n 1) if [ -z "$BRANCH" ]; then echo "Branch not found for tag $TAG" exit 1 @@ -55,7 +57,7 @@ jobs: run: git checkout ${BRANCH} - name: Update README - run: sed -i 's/com\.xemantic\.kotlin:xemantic-kotlin-swing-dsl-\(core\|test\):[0-9]\+\(\.[0-9]\+\)*\>/com.xemantic.kotlin:xemantic-kotlin-swing-dsl-\1:${{ VERSION }}/g' README.md + run: sed -i 's/com\.xemantic\.kotlin:xemantic-kotlin-swing-dsl-\(core\|test\):[0-9]\+\(\.[0-9]\+\)*\>/com.xemantic.kotlin:xemantic-kotlin-swing-dsl-\1:$VERSION/g' README.md - name: Create Pull Request uses: peter-evans/create-pull-request@v6