测试Fabric #35
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: 测试Fabric | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- 'fabric/**' | |
- 'origin/**' | |
permissions: | |
contents: write | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Generate Matrix | |
id: set-matrix | |
run: | | |
chmod 777 matrix.sh && ./matrix.sh -path "fabric" | |
test: | |
runs-on: ubuntu-latest | |
needs: generate-matrix | |
strategy: | |
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Chose JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Read version.txt and save to variable | |
run: | | |
mod_version=$(cat version.txt) | |
echo "Version: $mod_version" | |
echo "MOD_VERSION=$mod_version" >> "$GITHUB_ENV" | |
- name: Init Files | |
run: | | |
chmod 777 init.sh && ./init.sh | |
- name: Build | |
run: | | |
cd ${{ matrix.config.mc-loader }}/${{ matrix.config.mc-loader }}-${{ matrix.config.mc-version }} | |
chmod 777 gradlew && ./gradlew clean build | |
cd ../.. | |
- name: Show Files | |
run: | | |
ls ChatImage-jar/${{ env.MOD_VERSION }} |