From bf8065fa73aa33c26ed6dd67a67554660c1aff3b Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Sat, 2 Jul 2022 10:27:40 +0300 Subject: [PATCH] Create ore-upload.yml --- .github/workflows/ore-upload.yml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ore-upload.yml diff --git a/.github/workflows/ore-upload.yml b/.github/workflows/ore-upload.yml new file mode 100644 index 000000000..5e0efa4db --- /dev/null +++ b/.github/workflows/ore-upload.yml @@ -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