Add fake asset #2707
Workflow file for this run
This file contains hidden or 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: Build master | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: var | |
| name: Setup variables | |
| run: echo ::set-output name=commit_hash::${GITHUB_SHA:0:7} | |
| - uses: actions/checkout@v2 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-home-cache-excludes: | | |
| caches/neoformruntime/assets | |
| - name: Restore cached Minecraft assets | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches/neoformruntime/assets | |
| key: mc-assets-does-not-exist | |
| restore-keys: mc-assets- | |
| - name: Test adding a fake asset | |
| run: | | |
| mkdir -p ~/.gradle/caches/neoformruntime/assets/modern_industrialization | |
| echo "This is a test asset" > ~/.gradle/caches/neoformruntime/assets/modern_industrialization/test.txt | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| env: | |
| MI_VERSION: 0.0.0-git-${{ steps.var.outputs.commit_hash }} | |
| - name: Gametest Server | |
| run: | | |
| ./gradlew runGameTestServer | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Modern Industrialization ${{ steps.var.outputs.commit_hash }} | |
| path: build/libs | |
| - name: Hash Minecraft assets | |
| id: hash-assets | |
| run: | | |
| find ~/.gradle/caches/neoformruntime/assets -type f -exec sha256sum {} + | sort | sha256sum | cut -d ' ' -f 1 > assets-hash.txt | |
| echo "assets_hash=$(cat assets-hash.txt)" >> $GITHUB_ENV | |
| echo "::set-output name=assets_hash::$(cat assets-hash.txt)" | |
| - name: Cache Minecraft assets | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches/neoformruntime/assets | |
| key: mc-assets-${{ steps.hash-assets.outputs.assets_hash }} |