diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 0989c44a..be8c9dd8 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -9,41 +9,11 @@ on: - 1.18-forge tags-ignore: - 'v*' - workflow_dispatch: - inputs: - name: - required: false - default: 'workflow_dispatch' jobs: - first: - name: Set variables - runs-on: ubuntu-latest - outputs: - ci_version: ${{ steps.set_outputs.outputs.ci_version }} - full_version: ${{ steps.set_outputs.outputs.full_version }} - - steps: - - uses: actions/checkout@v2 - - - id: set_envs - name: Set environment variables - run: | - prop() { grep -P "^\s*[^#]?${1}=.*$" './gradle.properties' | cut -d'=' -f2; } - echo "ARNICALIB_VERSION=`echo $(prop "arnicalib_version")`" >> $GITHUB_ENV - echo "MINECRAFT_VERSION=`echo $(prop "minecraft_version")`" >> $GITHUB_ENV - echo "CI_VERSION=`echo dev-rev.${GITHUB_SHA:0:7}-build.${{github.run_number}}`" >> $GITHUB_ENV - - - id: set_outputs - name: Set outputs - run: | - echo "::set-output name=ci_version::${{env.CI_VERSION}}" - echo "::set-output name=full_version::arnicalib-${{env.MINECRAFT_VERSION}}-${{env.ARNICALIB_VERSION}}-${{env.CI_VERSION}}" - - second: + build: name: Build runs-on: ubuntu-latest - needs: first steps: - uses: actions/checkout@v2 @@ -56,15 +26,19 @@ jobs: architecture: x64 - name: Set up Gradle - run: chmod +x ./gradlew + run: | + chmod +x ./gradlew + rm -rf tmp + mkdir tmp - name: Build with Gradle - env: - CI_VERSION: ${{needs.first.outputs.ci_version}} - run: ./gradlew clean build + run: ./gradlew clean build outputProjectFullname + + - name: Read project full name + run: echo "PROJECT_FULL_NAME=`cat ./tmp/fullname.txt`" >> $GITHUB_ENV - name: Upload build artifacts uses: actions/upload-artifact@v1 with: - name: ${{needs.first.outputs.full_version}} + name: ${{env.PROJECT_FULL_NAME}} path: build/libs diff --git a/gradle/version.gradle b/gradle/version.gradle index 9b5f27a6..31687403 100644 --- a/gradle/version.gradle +++ b/gradle/version.gradle @@ -6,7 +6,6 @@ def getBuildVersion() { def dev = getEnvAsBoolean('IS_RELEASE') ? '' : 'dev-' def sha = System.getenv('GITHUB_SHA').substring(0, 7) def buildNumber = System.getenv('GITHUB_RUN_NUMBER') - return "${dev}rev.${sha}-build.${buildNumber}" } else { return System.getenv('CI_VERSION')