|
| 1 | +# This workflow will build a Java project with Maven |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven |
| 3 | + |
| 4 | +name: Prerelease Publisher |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ master ] |
| 9 | + tags-ignore: |
| 10 | + - 'v*' # do not run on tags, as we run the full publish then |
| 11 | + paths-ignore: |
| 12 | + - 'bin/' |
| 13 | + - 'docs_manual/' |
| 14 | + - '.github/' |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + |
| 19 | + runs-on: ubuntu-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - name: Set up JDK 12 |
| 24 | + uses: actions/setup-java@v1 |
| 25 | + with: |
| 26 | + java-version: 12 |
| 27 | + - name: Build with Maven |
| 28 | + # without -DskipTests, we also run tests, which should prevent |
| 29 | + # the package from being packaged if tests fail |
| 30 | + run: mvn -B package --file pom.xml -P dist |
| 31 | + - name: Determine Prerelease Name |
| 32 | + id: name_determiner |
| 33 | + run: echo "##[set-output name=name;]DataShot-$(date +'%Y%m%d')-beta" |
| 34 | + - name: Create Pre-release |
| 35 | + id: create_prerelease |
| 36 | + if: success() |
| 37 | + uses: actions/create-release@v1 |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + with: |
| 41 | + tag_name: untagged-${{ steps.name_determiner.outputs.name }}-${{ github.sha }} |
| 42 | + release_name: ${{ steps.name_determiner.outputs.name }} |
| 43 | + body: "Momentary Snapshot Version. Refer to the git history, [commit log](https://github.com/BernhardWebstudio/PreCapture/commits/master) for current changes" |
| 44 | + draft: false |
| 45 | + prerelease: true |
| 46 | + - name: Upload Pre-release |
| 47 | + id: upload_prerelease |
| 48 | + if: success() |
| 49 | + #uses: actions/upload-release-asset@v1 |
| 50 | + #env: |
| 51 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + #with: |
| 53 | + # 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 |
| 54 | + # asset_path: ./my-artifact.zip |
| 55 | + # asset_name: my-artifact.zip |
| 56 | + # asset_content_type: application/zip |
| 57 | + uses: csexton/release-asset-action@v2 |
| 58 | + with: |
| 59 | + pattern: "target/Precapture*.jar" |
| 60 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + release-url: ${{ steps.create_prerelease.outputs.upload_url }} |
0 commit comments