This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
367ad69
commit 095120f
Showing
2 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Release to Ore and GH Releases | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[2-9]*' | ||
workflow_dispatch: | ||
|
||
env: | ||
NUCLEUS_CHANGELOG_NAME: "changelog" | ||
|
||
jobs: | ||
buildAndPublish: | ||
runs-on: ubuntu-latest | ||
environment: ore | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Build | ||
run: ./gradlew clean build | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: plugin | ||
path: 'output/*-plugin.jar' | ||
if-no-files-found: error | ||
- name: Upload Description | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: changelog | ||
path: 'output/changelog.md' | ||
if-no-files-found: error | ||
- name: Upload to Ore | ||
uses: dualspiral/ore-upload-action@v2 | ||
with: | ||
plugin: plugin | ||
description: changelog | ||
apiKey: ${{ secrets.ORE_API_KEY }} | ||
pluginId: "nucleus" | ||
- name: Upload to Github Releases | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
prerelease: ${{ contains(github.ref, 'BETA') || contains(github.ref, 'ALPHA') || contains(github.ref, 'RC') || contains(github.ref, 'PR') }} | ||
body_path: output/changelog.md | ||
files: output/*.jar | ||
- name: Get tag | ||
id: tagval | ||
uses: mad9000/actions-find-and-replace-string@2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
source: ${{ github.ref }} | ||
find: 'refs/tags/' | ||
replace: '' | ||
- name: Notify Discord | ||
uses: sarisia/actions-status-discord@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
with: | ||
nodetail: true | ||
title: Nucleus ${{ steps.tagval.outputs.value }} has been released! | ||
description: 'Download it from Ore by clicking here!' | ||
url: https://ore.spongepowered.org/Nucleus/Nucleus/versions/${{ steps.tagval.outputs.value }} | ||
color: 0x00ff40 |
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