1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00
Slimefun4/.github/workflows/preview-builds.yml

63 lines
1.7 KiB
YAML
Raw Normal View History

2023-06-21 20:34:37 +00:00
name: Preview builds
on:
push:
branches-ignore:
- master
pull_request:
paths:
- 'src/**'
- 'pom.xml'
permissions:
pull-requests: write
contents: read
jobs:
preview:
if: ${{ github.repository_owner == 'Slimefun' }}
name: Build and Publish the jar
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3.11.0
with:
distribution: 'adopt'
java-version: '17'
java-package: jdk
architecture: x64
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn package
- name: Upload to preview service
run: |
curl -X POST \
-H 'Authorization: ${{ secrets.PUBLISH_TOKEN }}' \
-H "X-Checksum: $(sha256sum 'target/Slimefun v4.9-UNOFFICIAL.jar')" \
--data-binary '@target/Slimefun v4.9-UNOFFICIAL.jar' \
https://preview-builds.walshy.dev/upload/Slimefun/${{ github.event.number }}/${{ github.run.number }}
- name: Post comment
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
#### Slimefun preview jar
This is the preview jar for this Pull Request.
This can be used for reviewers to test this PR.
2023-06-21 20:36:51 +00:00
https://preview-builds.walshy.dev/download/Slimefun/${{ github.event.number }}/${{ github.run.number }}
2023-06-21 20:34:37 +00:00
2023-06-21 20:36:51 +00:00
*Pusher: @${{ github.actor }}, Action: ${{ github.event_name }}*