added the UnprocessableContentResult #18
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: Build and upload | |
| on: | |
| push: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| workflow_dispatch: | |
| release: | |
| types: | |
| - created | |
| env: | |
| USERNAME: ${{ github.actor }} | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| WLIB_SNAPSHOT: ${{ github.event_name != 'release' }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Get current date | |
| run: echo "WLIB_BUILD_DATE=$(date +'%Y-%m-%d_%H-%M-%S')" >> "$GITHUB_ENV" | |
| - name: Get snapshot number | |
| run: echo "WLIB_SNAPSHOT_NUMBER=$((${{ github.run_number }}+${{ github.run_attempt }}+68))" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build | |
| run: ./gradlew build | |
| - name: Upload results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: "**/build/libs/*.jar" | |
| name: WLib-${{ env.WLIB_BUILD_DATE }} | |
| if-no-files-found: error | |
| - name: Upload to the release | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| for file in */build/libs/*.jar; do | |
| gh release upload ${{ github.event.release.tag_name }} $file | |
| done | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| if: ${{ github.event_name != 'pull_request' }} | |
| needs: | |
| - build | |
| steps: | |
| - name: Get current date | |
| run: echo "WLIB_BUILD_DATE=$(date +'%Y-%m-%d_%H-%M-%S')" >> "$GITHUB_ENV" | |
| - name: Get snapshot number | |
| run: echo "WLIB_SNAPSHOT_NUMBER=$((${{ github.run_number }}+${{ github.run_attempt }}+68))" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Clean, Build and Publish | |
| run: ./gradlew publish | |