mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 18:47:20 +01:00
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Publish package to GitHub Packages
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'adopt'
|
|
cache: gradle
|
|
|
|
- name: Get release
|
|
id: get_release
|
|
uses: bruceadams/get-release@v1.3.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
- name: Validate Gradle wrapper
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
- name: Publish package
|
|
uses: gradle/gradle-build-action@v2
|
|
with:
|
|
arguments: publish
|
|
env:
|
|
GITHUB_VERSION: ${{ steps.get_release.outputs.tag }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload release artifact
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
|
asset_path: build/libs/Multiverse-Core-${{ steps.get_release.outputs.tag }}.jar
|
|
asset_name: Multiverse-Core-${{ steps.get_release.outputs.tag }}.jar
|
|
asset_content_type: application/java-archive
|