Skip to content

Update ci.yml

Update ci.yml #7

Workflow file for this run

name: CI for ExampleMod
on:
push:
paths:
- common/**
- fabric/**
- forge/**
- build.gradle
- gradle.properties
- settings.gradle
- .github/**
pull_request:
paths:
- common/**
- fabric/**
- forge/**
- build.gradle
- gradle.properties
- settings.gradle
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_RUN_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }}
steps:
- name: checkout
uses: actions/checkout@v3.1.0
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java 17
uses: actions/setup-java@v3.6.0
with:
distribution: zulu
java-version: 17
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
env:
GITHUB_RUN_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }}
run: ./gradlew build
- name: Read Properties
id: 'properties'
uses: christian-draeger/read-properties@1.1.1
with:
path: gradle.properties
properties: 'mod_id mod_name'
- name: Get Version
id: version
run: |
version=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-forge-|.jar' '{print $2}')
echo version=$version >> $GITHUB_OUTPUT
- name: capture build artifacts
uses: actions/upload-artifact@v3.1.1
with:
name: "${{ steps.properties.outputs.mod_name }}-${{ steps.version.outputs.version }}"
path: |
fabric/build/libs/*.jar
forge/build/libs/*.jar