forked from Nats-ji/paper-sand-dupe-unpatched
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (100 loc) · 3.16 KB
/
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
name: Release
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
outputs:
need_update: ${{ env.json_Update }}
filename: ${{ env.json_FileName }}
content: ${{ env.json_Body }}
title: ${{ env.json_Title }}
version: ${{ env.json_Version }}
prerelease: ${{ env.json_PreRelease }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Node.js 14
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "temurin"
- name: Configure git credentials
uses: OleksiyRudenko/[email protected]
with:
global: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Version and Build
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npm start
- name: Load output file to env
uses: antifree/[email protected]
with:
filename: output.json
- name: Upload Artifacts
if: ${{ env.json_Update == 'true' }}
uses: actions/upload-artifact@v3
with:
name: package
path: |
${{ env.json_FileName }}
README_zh.md
release-github:
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.outputs.need_update == 'true' }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: package
- name: Create Release on Github
uses: ncipollo/release-action@v1
with:
artifacts: ${{ needs.build.outputs.filename }}
body: ${{ needs.build.outputs.content }}
name: ${{ needs.build.outputs.title }}
tag: ${{ needs.build.outputs.version }}
prerelease: ${{ needs.build.outputs.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
release-3dm:
runs-on: ubuntu-latest
needs: build
if: ${{ needs.build.outputs.need_update == 'true' && github.repository_owner == 'Nats-ji' }}
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: package
- name: Update into on 3dm
uses: GlossMod/ActionUpdateMod@v1
id: update_3dm
with:
appid: ${{ secrets.APPID_3DM }}
appkey: ${{ secrets.APPKEY_3DM }}
id: ${{ secrets.MODID_3DM }}
version: ${{ needs.build.outputs.version }}
content: README_zh.md
file: ${{ needs.build.outputs.filename }}
zip-only: true
- name: Upload file to 3dm
uses: Nats-ji/Action3DMLargeFileUpload@v1
with:
username: ${{ secrets.USERNAME_3DM }}
password: ${{ secrets.PASSWORD_3DM }}
cookies: ${{ secrets.COOKIES_3DM }}
id: ${{ secrets.MODID_3DM }}
file: ${{ steps.update_3dm.outputs.file }}
filename: paper-sand-dupe-unpatched-${{ needs.build.outputs.version }}