Fix merge issues from pre-5.2 to 5.2 code #186
This file contains 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: Gradle Tests and Nightly (CI) | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- v* | |
paths-ignore: | |
- "README.md" | |
- "LICENSE" | |
- ".github/**/*" | |
jobs: | |
vars: | |
name: Get Variables | |
runs-on: ubuntu-20.04 | |
outputs: | |
release_type: ${{steps.cf_release_type.outputs.value }} | |
version: ${{steps.version.outputs.version }} | |
build: ${{steps.build.outputs.buildver}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Find Current Tag | |
id: current | |
uses: jimschubert/query-tag-action@v1 | |
with: | |
include: 'v*' | |
exclude: '*-rc*' | |
commit-ish: '@' | |
skip-unshallow: 'true' | |
- name: Release Type | |
id: cf_release_type | |
uses: christian-draeger/[email protected] | |
with: | |
path: './gradle.properties' | |
property: 'cf_release_type' | |
- name: Semver Version | |
id: version | |
run: | | |
version=$(echo "${{steps.current.outputs.tag}}" | cut -dv -f2) | |
echo "::set-output name=version::$version" | |
- name: Build Version | |
id: build | |
run: | | |
buildver=$(git describe --tags --match v* | cut -d- -f2) | |
echo "build = $buildver" | |
echo "::set-output name=buildver::$buildver" | |
tests: | |
name: Gradle Tests | |
runs-on: ubuntu-20.04 | |
needs: [ vars ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Unshallow and Get Tags | |
run: git fetch --prune --unshallow --tags | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: "17" | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Create datagen assets | |
continue-on-error: true | |
run: ./gradlew runData | |
env: | |
CM_RELEASE: false | |
CM_SEMVER_VERSION: ${{ needs.vars.outputs.version }} | |
CM_BUILD_NUM: ${{ needs.vars.outputs.build }} | |
- name: Test JAR with GameTest Server | |
run: ./gradlew runGameTestServer | |
env: | |
CM_RELEASE: false | |
CM_SEMVER_VERSION: ${{ needs.vars.outputs.version }} | |
CM_BUILD_NUM: ${{ needs.vars.outputs.build }} | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload build failure | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-data | |
path: run/gametest | |
nightly: | |
name: Publish Nightly | |
runs-on: ubuntu-20.04 | |
needs: [ vars, tests ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Unshallow and Get Tags | |
run: git fetch --prune --unshallow --tags | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: "17" | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Generate Resources | |
run: ./gradlew runData | |
env: | |
CM_RELEASE: false | |
CM_SEMVER_VERSION: ${{ needs.vars.outputs.version }} | |
CM_BUILD_NUM: ${{ needs.vars.outputs.build }} | |
- name: Publish gradle nightly jar | |
run: ./gradlew publishReleasePublicationToGitHubPackagesRepository | |
env: | |
CM_RELEASE: false | |
CM_SEMVER_VERSION: ${{ needs.vars.outputs.version }} | |
CM_BUILD_NUM: ${{ needs.vars.outputs.build }} | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |