feat: re-add readme stuff #2
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: CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - multiloader | |
| pull_request: | |
| branches: | |
| - main | |
| - multiloader | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: 'gradle' | |
| - name: Get commit SHA | |
| id: commit_sha | |
| run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Read current version from gradle.properties | |
| id: get_version | |
| run: | | |
| version=$(grep -A 1 "# GH_WORKFLOW::VERSION" gradle.properties | grep -oP '(?<=version=).*') | |
| echo "current_version=$version" >> $GITHUB_OUTPUT | |
| - name: Set dynamic version | |
| id: set_version | |
| run: | | |
| DYNAMIC_VERSION="${{ steps.get_version.outputs.current_version }}-${{ steps.commit_sha.outputs.sha }}" | |
| echo "Dynamic version: $DYNAMIC_VERSION" | |
| echo "new_version=$DYNAMIC_VERSION" >> $GITHUB_OUTPUT | |
| - name: Update gradle.properties | |
| run: | | |
| sed -i "s/^version=.*/version=${{ steps.set_version.outputs.new_version }}/" gradle.properties | |
| cat gradle.properties | |
| - name: Build | |
| run: ./gradlew build | |
| - name: Upload artifacts (Fabric) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "mismatched-chests-fabric" | |
| path: "./fabric/build/libs/mismatched_chests-fabric-1.21-${{ steps.set_version.outputs.new_version }}*.jar" | |
| - name: Upload artifacts (Neoforge) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "mismatched-chests-neoforge" | |
| path: "./neoforge/build/libs/mismatched_chests-neoforge-1.21-${{ steps.set_version.outputs.new_version }}*.jar" | |
| - name: Upload artifacts (Forge) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "mismatched-chests-forge" | |
| path: "./forge/build/libs/Mismatched Chests-forge-1.21-${{ steps.set_version.outputs.new_version }}*.jar" |