|
| 1 | +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven |
| 3 | + |
| 4 | +# This workflow uses actions that are not certified by GitHub. |
| 5 | +# They are provided by a third-party and are governed by |
| 6 | +# separate terms of service, privacy policy, and support |
| 7 | +# documentation. |
| 8 | + |
| 9 | +name: Java CI with Maven |
| 10 | + |
| 11 | +on: |
| 12 | + push: |
| 13 | + branches: [ "all-stable-features-and-fixes" ] |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + - name: Set up JDK 17 |
| 23 | + uses: actions/setup-java@v3 |
| 24 | + with: |
| 25 | + java-version: '17' |
| 26 | + distribution: 'temurin' |
| 27 | + cache: maven |
| 28 | + - name: Build with Maven |
| 29 | + run: mvn install |
| 30 | + - name: Create Release |
| 31 | + id: create_release |
| 32 | + uses: actions/create-release@v1 |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + with: |
| 36 | + tag_name: dev-build |
| 37 | + release_name: Automatic Dev Build of ${{ github.ref_name }} (${{ github.sha }}) |
| 38 | + draft: false |
| 39 | + prerelease: true |
| 40 | + - name: Upload Release Asset |
| 41 | + id: upload-release-asset |
| 42 | + uses: actions/upload-release-asset@v1 |
| 43 | + env: |
| 44 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + with: |
| 46 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 47 | + asset_path: ./target/greenmail-http-2.0.1.jar # TODO use wildcard? |
| 48 | + asset_name: greenmail-http-2.0.1.jar |
| 49 | + asset_content_type: application/java-archive |
| 50 | + |
| 51 | + # TODO remove older prereleases, only keeping x |
| 52 | + |
| 53 | + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive |
| 54 | + #- name: Update dependency graph |
| 55 | + # uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 |
0 commit comments