Skip to content
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
36 changes: 16 additions & 20 deletions .github/workflows/sedr-library-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
needs: Calculate-Version
permissions:
contents: read
packages: read

runs-on: ubuntu-latest

Expand Down Expand Up @@ -127,7 +126,6 @@ jobs:
if: ${{ needs.Calculate-Version.outputs.next_version != '' }}
permissions:
contents: read
packages: write

runs-on: ubuntu-latest

Expand Down Expand Up @@ -164,18 +162,10 @@ jobs:
- name: Publish SEDR Library
run: |
cd sedr-library
if echo "$MAVEN_OR_GITHUB" | grep -iq "^maven$"; then
echo "Publishing to Maven Central via jReleaser"
./gradlew publishMavenPublicationToStagingDeployRepository
./gradlew jreleaserDeploy
else
echo "Publishing to GitHub Packages"
./gradlew publishMavenPublicationToGitHubPackagesRepository
fi
echo "Publishing to Maven Central via jReleaser"
./gradlew publishMavenPublicationToStagingDeployRepository
./gradlew jreleaserDeploy
env:
MAVEN_OR_GITHUB: ${{ vars.MAVEN_OR_GITHUB }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.SEDR_AUTOMATION_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.SIGNING_KEY }}
Expand All @@ -202,18 +192,24 @@ jobs:
ref: main
token: ${{ secrets.SEDR_AUTOMATION_TOKEN }}

- name: Update version in README.adoc
- name: Update version in sedr-library README
run: |
sed -i "s/|Latest version |.\`[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*\`/|Latest version |\`${{ env.VERSION }}\`/" README.adoc
sed -i "s/sedr-library:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*/sedr-library:${{ env.VERSION }}/g" README.adoc
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*</version>|<version>${{ env.VERSION }}</version>|" README.adoc
sed -i "s/|Latest version |.\`[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*\`/|Latest version |\`${{ env.VERSION }}\`/" sedr-library/README.adoc
sed -i "s/sedr-library:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*/sedr-library:${{ env.VERSION }}/g" sedr-library/README.adoc
sed -i "s|<version>[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*</version>|<version>${{ env.VERSION }}</version>|" sedr-library/README.adoc

- name: Upload updated sedr-library README
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sedr-library-readme-${{ env.VERSION }}
path: sedr-library/README.adoc

- name: Commit and push updated README.adoc
- name: Commit and push updated sedr-library README
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add README.adoc
git diff --cached --quiet || git commit -m "docs(readme): update version to ${{ env.VERSION }} [skip ci]"
git add sedr-library/README.adoc
git diff --cached --quiet || git commit -m "docs(sedr-library): update README version to ${{ env.VERSION }} [skip ci]"
git push

Determine-Release-Type:
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/spring-rules-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,51 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.SIGNING_PUBLIC_KEY }}

Update-README:
name: Update README version
needs: [Calculate-Version, Publish]
if: ${{ needs.Calculate-Version.outputs.next_version != '' }}
permissions:
contents: write
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.Calculate-Version.outputs.next_version }}

steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: main
token: ${{ secrets.SEDR_AUTOMATION_TOKEN }}

- name: Update version in hexagonal-spring-rules README
run: |
sed -i -E "s#^\|Latest version \|.*#|Latest version |\`${{ env.VERSION }}\`#" hexagonal-spring-rules/README.adoc
sed -i -E "s#(architecture-validator-hexagonal-spring-rules:)(<version>|[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*[a-zA-Z0-9.-]*)#\1${{ env.VERSION }}#g" hexagonal-spring-rules/README.adoc

- name: Upload updated hexagonal-spring-rules README
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: hexagonal-spring-rules-readme-${{ env.VERSION }}
path: hexagonal-spring-rules/README.adoc

- name: Commit and push updated hexagonal-spring-rules README
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add hexagonal-spring-rules/README.adoc
git diff --cached --quiet || git commit -m "docs(hexagonal-spring-rules): update README version to ${{ env.VERSION }} [skip ci]"
git push

Determine-Release-Type:
needs: [Calculate-Version]
if: ${{ needs.Calculate-Version.outputs.next_version != '' }}
uses: ./.github/workflows/determine-release-type.yml

Workflow-Summary:
name: Workflow Summary
needs: [Build, Security-Scan, Publish, Release-Spring-Rules, Determine-Release-Type]
needs: [Build, Security-Scan, Publish, Update-README, Release-Spring-Rules, Determine-Release-Type]
if: always()
runs-on: ubuntu-latest
steps:
Expand Down
Loading
Loading