Refactor package structure to com.gportal.a2s and add IP binding fo…
#5
Workflow file for this run
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: Java CI/CD | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Set version | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| echo "REVISION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| else | |
| echo "REVISION=0.0.0-SNAPSHOT" >> $GITHUB_ENV | |
| fi | |
| - name: Build with Maven | |
| run: mvn -B package -Drevision=${{ env.REVISION }} --file pom.xml | |
| publish: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build-and-test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| server-id: github | |
| - name: Publish to GitHub Packages | |
| run: mvn -B deploy -DskipTests -Drevision=${{ github.ref_name }} --file pom.xml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |