2022-07-06 19:45:16 +02:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [ published ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update_versions_txt:
|
2022-08-18 14:31:25 +02:00
|
|
|
name: Update versions.txt
|
2022-07-06 19:45:16 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout 🛎️
|
|
|
|
uses: actions/checkout@v2.3.1
|
|
|
|
- name: Get Download URL
|
|
|
|
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
|
|
|
|
echo "RELEASE_DOWNLOAD_URL=$(cat url.txt)" >> $GITHUB_ENV
|
|
|
|
- name: Write REL release line
|
|
|
|
if: ${{ github.event.release.prerelease == false }}
|
|
|
|
run: |
|
2022-07-10 14:38:07 +02:00
|
|
|
echo "REL|${{ github.event.release.tag_name }}|${{ env.RELEASE_DOWNLOAD_URL }}|https://github.com/plan-player-analytics/Plan/releases" > release_line.txt
|
2022-07-06 19:45:16 +02:00
|
|
|
- name: Write DEV release line
|
|
|
|
if: ${{ github.event.release.prerelease == true }}
|
|
|
|
run: |
|
2022-07-15 08:31:51 +02:00
|
|
|
echo "DEV|${{ github.event.release.tag_name }}|${{ env.RELEASE_DOWNLOAD_URL }}|${{ github.event.release.html_url }}" > release_line.txt
|
2022-08-18 14:31:25 +02:00
|
|
|
- name: Append to versions.txt
|
2022-07-06 19:45:16 +02:00
|
|
|
run: |
|
2022-08-18 14:31:25 +02:00
|
|
|
cat versions.txt > temp.txt
|
|
|
|
cat release_line.txt temp.txt > versions.txt
|
2022-07-06 19:45:16 +02:00
|
|
|
- name: Commit and push changes
|
|
|
|
uses: EndBug/add-and-commit@v9
|
|
|
|
with:
|
|
|
|
committer_name: GitHub Actions
|
|
|
|
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
|
2022-08-18 14:31:25 +02:00
|
|
|
message: Update versions.txt ${{ github.event.release.name }}
|
|
|
|
add: versions.txt
|
2022-07-06 19:45:16 +02:00
|
|
|
|
|
|
|
update_html:
|
|
|
|
name: Update html-branch
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout 🛎️
|
|
|
|
uses: actions/checkout@v2.3.1
|
|
|
|
- name: Get git TAG
|
|
|
|
id: tagName
|
|
|
|
uses: olegtarasov/get-tag@v2.1
|
|
|
|
- name: Copy assets 🔧
|
|
|
|
run: |
|
|
|
|
mkdir -p workingdir/Plan/src/main/resources/assets/plan
|
|
|
|
mkdir -p workingdir/react/dashboard
|
|
|
|
cp -r Plan/common/src/main/resources/assets/plan workingdir/Plan/src/main/resources/assets/plan
|
2022-07-15 08:31:51 +02:00
|
|
|
cp -r Plan/react/dashboard workingdir/react/dashboard
|
2022-07-06 19:45:16 +02:00
|
|
|
- name: Deploy 🚀
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.0.0
|
|
|
|
with:
|
|
|
|
branch: html # The branch the action should deploy to.
|
|
|
|
folder: workingdir # The folder the action should deploy.
|
|
|
|
commit-message: ${{ steps.tagName.outputs.tag }}
|
|
|
|
|
|
|
|
upload_release_ore:
|
|
|
|
name: Ore Upload
|
|
|
|
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:
|
2022-07-15 08:31:51 +02:00
|
|
|
name: ${{ github.event.release.name }}
|
2022-07-06 19:45:16 +02:00
|
|
|
path: ${{ env.JAR_FILENAME }}
|
|
|
|
- name: Upload release to Ore 🚀
|
|
|
|
if: ${{ github.event.release.prerelease == false }}
|
|
|
|
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
|
|
|
|
- name: Upload DEV release to Ore 🚀
|
|
|
|
if: ${{ github.event.release.prerelease == true }}
|
|
|
|
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
|
|
|
|
|
|
|
|
upload_release_curseforge:
|
|
|
|
name: CurseForge Upload
|
|
|
|
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"))' > 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 release to CurseForge 🚀
|
|
|
|
if: ${{ github.event.release.prerelease == false }}
|
|
|
|
uses: itsmeow/curseforge-upload@master
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CF_API_TOKEN }}
|
|
|
|
project_id: 508727
|
|
|
|
game_endpoint: minecraft
|
|
|
|
file_path: ${{ env.JAR_FILENAME }}
|
|
|
|
changelog: ${{ github.event.release.body }}
|
|
|
|
changelog_type: markdown
|
|
|
|
display_name: ${{ github.event.release.name }}
|
|
|
|
game_versions: "2:Java 17,73407:1.19,Fabric"
|
|
|
|
release_type: release
|
|
|
|
relations: fabric-api:requiredDependency,luckperms:optionalDependency
|
|
|
|
- name: Upload prerelease to CurseForge 🚀
|
|
|
|
if: ${{ github.event.release.prerelease == true }}
|
|
|
|
uses: itsmeow/curseforge-upload@master
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CF_API_TOKEN }}
|
|
|
|
project_id: 508727
|
|
|
|
game_endpoint: minecraft
|
|
|
|
file_path: ${{ env.JAR_FILENAME }}
|
|
|
|
changelog: ${{ github.event.release.body }}
|
|
|
|
changelog_type: markdown
|
|
|
|
display_name: ${{ github.event.release.name }}
|
|
|
|
game_versions: "2:Java 17,73407:1.19,Fabric"
|
|
|
|
release_type: beta
|
|
|
|
relations: fabric-api:requiredDependency,luckperms:optionalDependency
|