PR Collection 开发进展 #1218
This file contains 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 | |
permissions: | |
actions: write | |
on: | |
push: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'HMCLauncher/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 8 | |
java-package: 'jdk+fx' | |
- name: Build with Gradle | |
run: ./gradlew build --no-daemon | |
env: | |
MICROSOFT_AUTH_ID: ${{ secrets.MICROSOFT_AUTH_ID }} | |
MICROSOFT_AUTH_SECRET: ${{ secrets.MICROSOFT_AUTH_SECRET }} | |
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} | |
- name: Get short SHA | |
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: HMCL-${{ env.SHORT_SHA }} | |
path: HMCL/build/libs | |
- name: Get Git Branch name | |
run: echo "BRANCH_NAME=$BN_TEMP" >> $GITHUB_ENV | |
env: | |
BN_TEMP: ${{ github.head_ref || github.ref_name }} | |
- name: Trigger HMCL Snapshot Update | |
if: ${{ env.BRANCH_NAME == 'prs' && github.event_name == 'push' }} | |
run: gh workflow --repo burningtnt/HMCL-Snapshot-Update run check.yml | |
env: | |
GH_TOKEN: ${{ secrets.HMCL_PR_COLLECTION_GITHUB_TOKEN }} |