Skip to content

Commit

Permalink
github action build_release another attempt to fix release process wi…
Browse files Browse the repository at this point in the history
…th README.md update (#14)
  • Loading branch information
morisil authored Aug 29, 2024
1 parent bd3dca1 commit 9e3d55d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ on:
pull_request:
branches-ignore:
- main

jobs:
build_branch:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4.1.7

- name: Setup Java
uses: actions/setup-java@v4.2.2
with:
distribution: 'temurin'
java-version: 22

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: ./gradlew build
3 changes: 3 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v4.1.7

- name: Setup Java
uses: actions/setup-java@v4.2.2
with:
distribution: 'temurin'
java-version: 22

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: ./gradlew build sourcesJar javadocJar publish
env:
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ jobs:
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4.2.2
with:
distribution: 'temurin'
java-version: 22

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: ./gradlew -Pversion=${VERSION} build sourcesJar javadocJar publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
Expand All @@ -35,10 +39,23 @@ jobs:
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUser: ${{ secrets.SONATYPE_USER }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
- name: Switch to branch HEAD
run: git checkout $(git branch --contains ${{ github.event.release.tag_name }})

- name: Find branch from tag
id: find-branch
run: |
BRANCH=$(git branch -r --contains ${{ github.event.release.tag_name }} | grep -v '\->' | sed 's/origin\///' | head -n 1)
if [ -z "$BRANCH" ]; then
echo "Branch not found for tag $TAG"
exit 1
fi
echo "::set-output name=branch::$BRANCH"
- name: Checkout branch HEAD
run: git checkout ${{ steps.find-branch.outputs.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

- name: Commit README
uses: stefanzweifel/git-auto-commit-action@v5
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.7
- name: Git checkout
uses: actions/checkout@v4.1.7
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.WORKFLOW_SECRET }}
Expand Down

0 comments on commit 9e3d55d

Please sign in to comment.