mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-01 14:38:55 +00:00
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
86 lines
2.1 KiB
YAML
86 lines
2.1 KiB
YAML
name: Build & Upload Release jar with Gradle
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'master'
|
|
tags:
|
|
- '*'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- 'master'
|
|
schedule:
|
|
- cron: '0 0 * * 6'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ format('{0}-{1}', github.job, github.ref) }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ ubuntu-latest ]
|
|
java: [ 17 ]
|
|
if: github.ref_type != 'tag'
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Gradle
|
|
uses: ./.github/actions/gradle
|
|
|
|
- name: Setup JDK
|
|
uses: ./.github/actions/jdk
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
|
|
- name: Build with Gradle
|
|
run: ./gradlew clean build --info
|
|
|
|
- name: Upload build results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.os }} Java ${{ matrix.java }} Snapshot
|
|
path: ${{ github.workspace }}/build/libs/
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
java: [ 17 ]
|
|
if: github.ref_type == 'tag'
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Gradle
|
|
uses: ./.github/actions/gradle
|
|
|
|
- name: Setup JDK
|
|
uses: ./.github/actions/jdk
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
|
|
- name: Set Release Environment Variable
|
|
if: github.ref_type == 'tag'
|
|
run: |
|
|
echo "CUSTOM_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
|
|
|
|
- name: Build with Gradle
|
|
run: ./gradlew clean build -PcustomVersion=${{ env.CUSTOM_VERSION }}
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
id: release
|
|
with:
|
|
name: ${{ format('Release {0}', github.ref_name) }}
|
|
files: ${{ github.workspace }}/build/libs/*
|
|
prerelease: ${{ contains(github.ref_name, '-RC-') }}
|
|
generate_release_notes: true
|
|
fail_on_unmatched_files: true
|
|
draft: false |