Skip to content

Commit

Permalink
feat: use central workflow actions (#92203)
Browse files Browse the repository at this point in the history
  • Loading branch information
skiesewetter-intershop committed Jan 11, 2024
1 parent b6d8ea8 commit 0e556ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 74 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,7 @@ jobs:
pull-requests: write
name: Build & Test with Java ${{ matrix.Java }} (${{ matrix.os }})
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --all --tags

- name: Create .gradle dir
run: mkdir -p $HOME/.gradle

- name: Build and test with Gradle
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
run: ./gradlew test build --stacktrace --scan

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
files: build/test-results/**/*.xml
- name: Setup
uses: IntershopCommunicationsAG/.github/actions/[email protected]
- name: Build
uses: IntershopCommunicationsAG/.github/actions/[email protected]
61 changes: 11 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,15 @@ jobs:
runs-on: ubuntu-latest
name: Run release build from tag
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
- name: Setup
uses: IntershopCommunicationsAG/.github/actions/[email protected]
- name: Release
uses: IntershopCommunicationsAG/.github/actions/[email protected]
with:
distribution: 'zulu'
java-version: 17

- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --all --tag

- name: Create .gradle dir
run: mkdir -p $HOME/.gradle

- name: Install gpg secret key
env:
SIGNINGFILE: ${{ secrets.SIGNINGFILE }}
run: |
cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Export gpg file
env:
SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
run: |
gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg
- name: Create gradle sproperties
env:
APIKEY: ${{ secrets.APIKEY }}
APISECRET: ${{ secrets.APISECRET }}
SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }}
SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }}
SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }}
SONATYPEUSER: ${{ secrets.SONATYPEUSER }}
run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties

- name: Run gradle release
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
run: ./gradlew -PrunOnCI=true test build :publishIntershopMvnPublicationToMavenRepository :publishPlugins --stacktrace --scan

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
files: build/test-results/**/*.xml

- name: Post Build
run: rm -f $HOME/.gradle/gradle.properties && rm -f $HOME/.docker/config.json
signing-file: ${{ secrets.SIGNINGFILE }}
signing-key-id: ${{ secrets.SIGNINGKEYID }}
signing-password: ${{ secrets.SIGNINGPASSWORD }}
api-key: ${{ secrets.APIKEY }}
api-secret: ${{ secrets.APISECRET }}
sonatype-user: ${{ secrets.SONATYPEUSER }}
sonatype-password: ${{ secrets.SONATYPEPASSWORD }}

0 comments on commit 0e556ce

Please sign in to comment.