Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github action build_release another attempt to fix release process wi… #14

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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