diff --git a/.build/justfile-for-release b/.build/justfile-for-release index e88e10544..0e0ede66f 100644 --- a/.build/justfile-for-release +++ b/.build/justfile-for-release @@ -29,7 +29,7 @@ init-gpg: # Initialize Git init-git: @echo "Git setup" - git config --global user.name "${GITHUB_ACTOR}" + git config --global user.name "smallrye-ci" git config --global user.email "smallrye@googlegroups.com" # Steps before releasing @@ -56,14 +56,17 @@ release: pre-release git push @echo "Call JReleaser" ./mvnw -settings .build/maven-ci-settings.xml --batch-mode --no-transfer-progress -Pjreleaser jreleaser:full-release -pl :mutiny-project - @echo "Deploy to Maven Central" - -./mvnw --settings maven-settings.xml --batch-mode --no-transfer-progress deploy -Prelease -DskipTests @echo "Bump to 999-SNAPSHOT and push upstream" ./mvnw --settings .build/maven-ci-settings.xml --batch-mode --no-transfer-progress versions:set -DnewVersion=999-SNAPSHOT -DgenerateBackupPoms=false ./mvnw --settings .build/maven-ci-settings.xml --batch-mode --no-transfer-progress versions:set -DnewVersion=999-SNAPSHOT -DgenerateBackupPoms=false -pl bom git commit -am "chore(release): set development version to 999-SNAPSHOT" git push +# Deploy to Maven Central +deploy-to-maven-central: decrypt-secrets init-gpg + @echo "Deploy to Maven Central" + ./mvnw --settings maven-settings.xml --batch-mode --no-transfer-progress deploy -Prelease -DskipTests + # Steps post-release post-release: @echo "🚀 Post-release steps..." diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index e8396bd83..e7090ac15 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -20,12 +20,12 @@ jobs: java-version: 11 distribution: temurin cache: maven + - name: Install just + uses: taiki-e/install-action@just - name: Build with Maven run: ./mvnw --no-transfer-progress -s .build/maven-ci-settings.xml -B clean verify - name: Deploy snapshots env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SECRET_FILES_PASSPHRASE: ${{ secrets.SECRET_FILES_PASSPHRASE }} - run: | - .build/decrypt-secrets.sh - .build/deploy-snapshot.sh + run: just -f .build/justfile-for-release -d . deploy-to-maven-central diff --git a/.github/workflows/push-release-to-maven-central.yml b/.github/workflows/push-release-to-maven-central.yml new file mode 100644 index 000000000..911704269 --- /dev/null +++ b/.github/workflows/push-release-to-maven-central.yml @@ -0,0 +1,25 @@ +name: Push a release to Maven Central + +on: + push: + tags: + - '2.*' + +jobs: + release: + runs-on: ubuntu-latest + env: + SECRET_FILES_PASSPHRASE: ${{ secrets.SECRET_FILES_PASSPHRASE }} + steps: + - name: Git checkout + uses: actions/checkout@v3 + - name: Java setup + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: maven + - name: Install just + uses: taiki-e/install-action@just + - name: Deploy tp Maven Central + run: just -f .build/justfile-for-release -d . deploy-to-maven-central diff --git a/pom.xml b/pom.xml index 58d232168..eab5da38c 100644 --- a/pom.xml +++ b/pom.xml @@ -547,6 +547,7 @@ dependabot[bot] bot jreleaserbot + smallrye-ci