Skip to content

Commit

Permalink
ci: update dev-build script
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Jan 20, 2022
1 parent f86e31b commit 08bb81d
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,44 @@ on:
- 1.18-forge
tags-ignore:
- 'v*'
workflow_dispatch:
inputs:
name:
required: false
default: 'workflow_dispatch'

jobs:
build:
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

- name: Set vars
- id: set_envs
name: Set environment variables
run: |
echo "CI_VERSION=`echo dev-rev.${GITHUB_SHA:0:7}-build.${{github.run_number}}`" >> $GITHUB_ENV
config='gradle.properties'
function prop {
[ -f "$config" ] && grep -P "^\s*[^#]?${1}=.*$" $config | cut -d'=' -f2
}
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:
name: Build
runs-on: ubuntu-latest
needs: first

steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
Expand All @@ -34,13 +55,16 @@ jobs:
distribution: 'temurin'
architecture: x64

- name: Set up Gradlew and build
run: |
chmod +x ./gradlew
./gradlew clean build
- name: Set up Gradlew
run: chmod +x ./gradlew

- name: Build with Gradlew
env:
CI_VERSION: ${{needs.first.outputs.ci_version}}
run: ./gradlew clean build

- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
name: arnicalib-${{env.MINECRAFT_VERSION}}-${{env.ARNICALIB_VERSION}}-${{env.CI_VERSION}}
name: ${{needs.first.outputs.full_version}}
path: build/libs

0 comments on commit 08bb81d

Please # to comment.