-
-
Notifications
You must be signed in to change notification settings - Fork 171
138 lines (132 loc) · 5.74 KB
/
on-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Release
on:
release:
types: [ published ]
jobs:
update_versions_txt:
name: Update versions.txt
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- 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: |
echo "REL|${{ github.event.release.tag_name }}|${{ env.RELEASE_DOWNLOAD_URL }}|https://github.com/plan-player-analytics/Plan/releases" > release_line.txt
- name: Write DEV release line
if: ${{ github.event.release.prerelease == true }}
run: |
echo "DEV|${{ github.event.release.tag_name }}|${{ env.RELEASE_DOWNLOAD_URL }}|${{ github.event.release.html_url }}" > release_line.txt
- name: Append to versions.txt
run: |
cat versions.txt > temp.txt
cat release_line.txt temp.txt > versions.txt
- 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
message: Update versions.txt ${{ github.event.release.name }}
add: versions.txt
push: origin HEAD:master
update_html:
name: Update html-branch
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- 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
cp -r Plan/react/dashboard workingdir/react/dashboard
- 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:
name: ${{ github.event.release.name }}
path: ${{ env.JAR_FILENAME }}
- name: Upload release to Ore 🚀
if: ${{ github.event.release.prerelease == false }}
uses: dualspiral/ore-upload-action@v2
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,75125:1.20,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,75125:1.20,Fabric"
release_type: beta
relations: fabric-api:requiredDependency,luckperms:optionalDependency