Skip to content

Commit

Permalink
ci: dev-build
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Aug 15, 2022
1 parent a8fcfec commit bbde381
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 37 deletions.
46 changes: 10 additions & 36 deletions .github/workflows/dev-build.yml
Expand Up @@ -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
Expand All @@ -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
1 change: 0 additions & 1 deletion gradle/version.gradle
Expand Up @@ -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')
Expand Down

0 comments on commit bbde381

Please sign in to comment.