2023-02-20 13:17:37 +01:00
|
|
|
name: Create Release Version & Publish Package
|
2023-02-19 22:13:23 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release_on_push:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-02-20 04:51:30 +01:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: '11'
|
|
|
|
distribution: 'adopt'
|
|
|
|
cache: gradle
|
|
|
|
|
|
|
|
- name: Validate Gradle wrapper
|
|
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
|
|
|
|
- name: Test & Build
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
arguments: clean build -x assemble -x shadowJar
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-02-19 22:13:23 +01:00
|
|
|
- name: Create release
|
2023-02-20 13:17:37 +01:00
|
|
|
id: release
|
2023-02-24 15:58:10 +01:00
|
|
|
uses: Multiverse/release-on-push-action@support_prerelease
|
2023-02-19 22:13:23 +01:00
|
|
|
env:
|
2023-02-20 13:17:37 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-19 22:13:23 +01:00
|
|
|
with:
|
|
|
|
bump_version_scheme: norelease
|
2023-02-20 06:04:43 +01:00
|
|
|
tag_prefix: ''
|
2023-02-24 17:44:06 +01:00
|
|
|
release_name: "<RELEASE_VERSION>"
|
2023-02-19 22:13:23 +01:00
|
|
|
use_github_release_notes: true
|
2023-02-20 13:17:37 +01:00
|
|
|
|
2023-02-24 17:15:36 +01:00
|
|
|
- name: Modify version scheme
|
|
|
|
run: |
|
2023-02-24 17:29:28 +01:00
|
|
|
if [[ "${{ steps.release.outputs.tag_name }}" == *"pre"* ]]; then
|
2023-02-24 17:15:36 +01:00
|
|
|
echo "Replacing prerelease version scheme with SNAPSHOT"
|
|
|
|
echo "VERSION=$(echo ${{ steps.release.outputs.tag_name }} | sed -E 's/-pre.*/-SNAPSHOT/')" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "Using release version scheme"
|
|
|
|
echo "VERSION=${{ steps.release.outputs.tag_name }}" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
|
2023-02-20 13:17:37 +01:00
|
|
|
- name: Publish package
|
|
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
with:
|
|
|
|
arguments: publish
|
|
|
|
env:
|
2023-02-24 17:15:36 +01:00
|
|
|
GITHUB_VERSION: ${{ env.VERSION }}
|
2023-02-20 13:17:37 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Upload release artifact
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-24 17:15:36 +01:00
|
|
|
file: build/libs/multiverse-core-${{ env.VERSION }}.jar
|
2023-02-20 13:17:37 +01:00
|
|
|
asset_name: multiverse-core-${{ steps.release.outputs.tag_name }}.jar
|
|
|
|
tag: ${{ steps.release.outputs.tag_name }}
|