Skip to content

Commit

Permalink
Wait for releases, more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
markpatton committed Dec 5, 2023
1 parent 2a6cb60 commit 7c3bb81
Showing 1 changed file with 52 additions and 9 deletions.
61 changes: 52 additions & 9 deletions .github/workflows/pass-java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,27 @@ jobs:
uses: actions/checkout@v3
with:
repository: eclipse-pass/pass-core
path: ./pass-core
path: pass-core

- name: Checkout pass-support
uses: actions/checkout@v3
with:
repository: eclipse-pass/pass-support
path: ./pass-support
path: pass-support

- name: Checkout playground for testing
uses: actions/checkout@v3
with:
repository: eclipse-pass/playground
path: playground

- name: Configure git user
run: |
git config --global user.name ${{ github.actor }}
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Create combined module
run: |
echo $GITHUB_WORKSPACE
ls -a $GITHUB_WORKSPACE
mkdir combined
cp main/pom.xml combined
cp -r pass-core combined
Expand All @@ -69,15 +73,52 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

# Build and deploy to sonatype if the release does not already exist.
- name: Release Java modules
working-directory: combined
run: |
mvn -B -U -V -ntp -P release clean install
goal="install"
if curl -f -s https://oss.sonatype.org/service/local/repositories/releases/content/org/eclipse/pass/eclipse-pass-parent/$RELEASE/ > /dev/null; then
echo "Release $RELEASE already exists"
goal="install"
fi
mvn -B -U -V -ntp -P release -DstagingProgressTimeoutMinutes=10 clean install | tee release.log
code=${PIPESTATUS[0]}
marker1="Remote staging repositories are being released"
marker2="Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin"
if [ "$code" -ne "0" ]; then
if grep -q "$marker1" release.log && grep -q "$marker2" release.log; then
echo "Failed cleaning up after pushing to Sonatype, but it may have succeeded anyway."
else
exit "$code"
fi
fi
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Wait for Sonatype artifacts
run: |
echo "Waiting for artifacts of $RELEASE to be released."
counter=0
until curl -f -s https://oss.sonatype.org/service/local/repositories/releases/content/org/eclipse/pass/eclipse-pass-parent/$RELEASE/ > /dev/null
do
sleep 60
echo "."
counter=$((counter+1))
if [ "$counter" -gt 20 ]; then
echo "Timed out waiting for release"
exit 1
fi
done
echo "Artifacts for $RELEASE have been released."
- name: Set the next dev version, commit the change, and tag it
run: |
(cd main && mvn versions:set -B -ntp -DnewVersion=$NEXT && git commit -am "Update version to $NEXT" && git tag $NEXT)
Expand All @@ -88,7 +129,7 @@ jobs:
- name: Release dev Java modules
working-directory: combined
run: |
mvn -B -V -ntp -P release clean install -DskipTests -DskipITs
mvn -B -V -ntp clean install -DskipTests -DskipITs
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down Expand Up @@ -119,6 +160,8 @@ jobs:
- name: Push the commits and tags
run: |
echo git push
# cd main && git push origin && git push origin --tags
# cd pass-core && git push origin && git push origin --tags
# cd pass-core && git push origin && git push origin --tags
(cd plaground && echo test >test.txt && git commit -am "Update version to $NEXT" && git tag $NEXT)
(cd plaground && git push origin && git push origin --tags)
# (cd main && git push origin && git push origin --tags)
# (cd pass-core && git push origin && git push origin --tags)
# (cd pass-core && git push origin && git push origin --tags)

0 comments on commit 7c3bb81

Please sign in to comment.