From 2689aab70cd65bf234def37d5407b78546cdef2b Mon Sep 17 00:00:00 2001 From: Eugene Platonov Date: Sun, 21 Apr 2024 19:40:01 -0400 Subject: [PATCH] Add release GH script --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d6273757 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release new version + +on: + workflow_dispatch + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: maven + server-id: central # Value of the distributionManagement/repository/id field of the pom.xml + server-username: SONATYPE_USERNAME + server-password: SONATYPE_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # has to be read directly from secrets + gpg-passphrase: MAVEN_GPG_PASSPHRASE # default name used by maven-gpg-plugin + + - name: Setup git profile + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "123456+github-actions[bot]@users.noreply.github.com" + + - name: Release new version + run: + mvn -B release:clean release:prepare release:perform -P release + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file