Create ore-upload.yml

This commit is contained in:
Aurora Lahtela 2022-07-02 10:27:40 +03:00 committed by GitHub
parent 216fc638c5
commit bf8065fa73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 58 additions and 0 deletions

58
.github/workflows/ore-upload.yml vendored Normal file
View File

@ -0,0 +1,58 @@
name: Upload artifact to Ore
on:
release:
types: [ published ]
jobs:
upload_release:
if: ${{ github.event.release.prerelease == false }}
runs-on: ubuntu-latest
steps:
- name: Download release artifact for upload
run: |
curl 'https://api.github.com/repos/plan-player-analytics/plan/releases/${{ github.event.release.id }}/assets' | jq -r '.[] | {name: .name, url: .browser_download_url} | select(.url | strings | test("Fabric") | not)' > asset.txt
jq -r '.url' asset.txt > url.txt
jq -r '.name' asset.txt > name.txt
wget -i url.txt
echo "JAR_FILENAME=$(cat name.txt)" >> $GITHUB_ENV
- name: Upload artifact for ore upload
uses: actions/upload-artifact@v3
with:
name: Plan.jar
path: ${{ env.JAR_FILENAME }}
- name: Upload release to Ore 🚀
uses: dualspiral/ore-upload-action@v1
with:
plugin: ${{ github.event.release.name }}
description: ${{ github.event.release.body }}
apiKey: ${{ secrets.ORE_API_TOKEN }}
channel: Release
pluginId: plan
createForumPost: true
upload_prerelease:
if: ${{ github.event.release.prerelease == true }}
runs-on: ubuntu-latest
steps:
- name: Download release artifact for upload
run: |
curl 'https://api.github.com/repos/plan-player-analytics/plan/releases/${{ github.event.release.id }}/assets' | jq -r '.[] | {name: .name, url: .browser_download_url} | select(.url | strings | test("Fabric") | not)' > asset.txt
jq -r '.url' asset.txt > url.txt
jq -r '.name' asset.txt > name.txt
wget -i url.txt
echo "JAR_FILENAME=$(cat name.txt)" >> $GITHUB_ENV
- name: Upload artifact for ore upload
uses: actions/upload-artifact@v3
with:
name: Plan.jar
path: ${{ env.JAR_FILENAME }}
- name: Upload release to Ore 🚀
uses: dualspiral/ore-upload-action@v1
with:
plugin: ${{ github.event.release.name }}
description: ${{ github.event.release.body }}
apiKey: ${{ secrets.ORE_API_TOKEN }}
channel: DEV
pluginId: plan
createForumPost: false