mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-23 00:31:25 +01:00
Move publish jobs back into publish action.
This commit is contained in:
parent
d2776ef448
commit
fc2cb6aeae
47
.github/workflows/publish.yml
vendored
Normal file
47
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
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
|
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
@ -35,27 +35,3 @@ jobs:
|
||||
tag_prefix: v
|
||||
release_name: "Release <RELEASE_VERSION>"
|
||||
use_github_release_notes: true
|
||||
|
||||
- name: Get release
|
||||
id: get_release
|
||||
uses: bruceadams/get-release@v1.3.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- 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
|
||||
|
Loading…
Reference in New Issue
Block a user