-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from gedestroy/migrate-to-github-actions
Migrate to GitHub actions
- Loading branch information
Showing
5 changed files
with
75 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Java CI with Maven | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
branches: [ "master", "develop" ] | ||
|
||
jobs: | ||
build_maven: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml | ||
server-username: CI_DEPLOY_USERNAME # env variable for username in deploy | ||
server-password: CI_DEPLOY_PASSWORD # env variable for token in deploy | ||
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
gpg-passphrase: CI_GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
|
||
- name: Install, unit test, integration test | ||
run: mvn install -Dmaven.javadoc.skip=true -B -V | ||
|
||
- name: Release to maven central | ||
if: github.ref_name == 'master' && github.event_name != 'pull_request' && github.repository == 'swisspost/vertx-rest-mirror' | ||
run: | | ||
curl -s get.sdkman.io | bash | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
sdk install groovy 3.0.8 | ||
chmod +x ./maybe-release.sh | ||
./maybe-release.sh | ||
env: | ||
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} | ||
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} | ||
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }} | ||
|
||
- name: After release | ||
run: bash <(curl -s https://codecov.io/bash) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,34 @@ | ||
#!/bin/bash | ||
set -ev | ||
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "swisspush/vertx-rest-mirror" ] | ||
git fetch | ||
git reset --hard | ||
groovy staging.groovy drop | ||
rc=$? | ||
if [ $rc -ne 0 ] | ||
then | ||
git reset --hard | ||
git clean -fd | ||
git checkout master | ||
echo 'Master checked out' | ||
groovy staging.groovy drop | ||
echo 'problem when trying to drop, ignored' | ||
fi | ||
echo 'starting a new nexus repository ...' | ||
OUTPUT=$(groovy staging.groovy start) | ||
echo "repository Id: $OUTPUT" | ||
mvn -B -Prelease jgitflow:release-start jgitflow:release-finish -DrepositoryId=${OUTPUT} | ||
rc=$? | ||
if [ $rc -eq 0 ] | ||
then | ||
groovy staging.groovy close ${OUTPUT} | ||
groovy staging.groovy promote ${OUTPUT} | ||
rc=$? | ||
if [ $rc -ne 0 ] | ||
then | ||
echo 'problem when trying to drop, ignored' | ||
fi | ||
echo 'starting a new nexus repository ...' | ||
OUTPUT=$(groovy staging.groovy start) | ||
echo "repository Id: $OUTPUT" | ||
mvn -B -Prelease -PpublicRepos jgitflow:release-start jgitflow:release-finish --settings settings.xml -DrepositoryId=${OUTPUT} | ||
rc=$? | ||
if [ $rc -eq 0 ] | ||
then | ||
groovy staging.groovy close ${OUTPUT} | ||
groovy staging.groovy promote ${OUTPUT} | ||
rc=$? | ||
if [ $rc -ne 0 ] | ||
then | ||
echo 'Release failed, cannot promote stage' | ||
exit rc | ||
fi | ||
echo 'Release done, will push' | ||
git tag | ||
git push --tags | ||
git checkout develop | ||
git push origin develop | ||
exit 0 | ||
echo 'Release failed, cannot promote stage' | ||
exit $rc | ||
fi | ||
echo 'Release failed' | ||
exit rc | ||
else | ||
echo 'Release skipped' | ||
exit 0 | ||
fi | ||
echo 'Release done, will push' | ||
git tag | ||
git push --tags | ||
git checkout develop | ||
git push origin develop | ||
exit 0 | ||
fi | ||
echo 'Release failed' | ||
exit $rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.