From 488e70d88e3a53f913d2bccf3d0a7e26ccfdefca Mon Sep 17 00:00:00 2001 From: Conor Egan <68134729+c-eg@users.noreply.github.com> Date: Tue, 21 Nov 2023 21:44:42 +0000 Subject: [PATCH] update github workflows --- .github/workflows/gradle.yml | 13 ++++++---- .github/workflows/release.yml | 49 +++++++++++++---------------------- 2 files changed, 26 insertions(+), 36 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9a4e3777..7f5b4796 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,16 +14,19 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v3 with: - distribution: corretto java-version: 17 + distribution: corretto - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: gradle-version: wrapper - - name: Execute Gradle build - run: ./gradlew build --scan + - name: Execute Gradle Build + run: ./gradlew clean build --scan diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bed2c12..5fb0c62b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,8 @@ -# Created with https://github.com/marketplace/actions/create-a-release +name: Publish package to the Maven Central Repository on: - push: - # Sequence of patterns matched against refs/tags -# branches: -# - master - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - -name: Create Release - + release: + types: [created] jobs: build: @@ -17,25 +10,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 - # https://github.community/t/accessing-commit-message-in-pull-request-event/17158/8 -# - name: get commit message -# run: | -# echo ::set-env name=commitmsg::$(git log --format=%B -n 1 ${{ github.event.after }}) -# - name: show commit message -# run: echo $commitmsg - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + uses: actions/checkout@v4 + + - name: Set up Maven Central Repository + uses: actions/setup-java@v3 with: - # https://stackoverflow.com/questions/63619329/github-action-get-commit-message -# tag_name: ${{ github.event.head_commit.message }} -# release_name: ${{ github.event.head_commit.message }} - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: | - See [CHANGES.md](https://www.kalasim.org/changes) for new features, bug-fixes and changes. - draft: false - prerelease: false \ No newline at end of file + java-version: 17 + distribution: corretto + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Publish package + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}