[1.6]重构连接管理并添加中间件 #11
This file contains hidden or 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
| name: SimpleTransfer build | |
| on: [ push ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| if: contains(github.event.head_commit.message, '[ci skip]') == false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout repository | |
| uses: actions/checkout@v5 | |
| - name: cache maven packages | |
| uses: actions/cache@v4.3.0 | |
| with: | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| path: ~/.m2/repository | |
| - name: setup jdk 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| - name: get version from pom.xml | |
| id: get_version | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version: $VERSION" | |
| - name: build with maven | |
| run: mvn clean package -DskipTests | |
| - name: capture build artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: SimpleTransfer-${{ steps.get_version.outputs.version }} | |
| path: target/simpletransfer-${{ steps.get_version.outputs.version }}.jar | |
| - name: create release | |
| uses: softprops/action-gh-release@v2.4.2 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| tag_name: v${{ steps.get_version.outputs.version }} | |
| name: SimpleTransfer ${{ steps.get_version.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: target/simpletransfer-${{ steps.get_version.outputs.version }}.jar |