-
-
Notifications
You must be signed in to change notification settings - Fork 180
99 lines (87 loc) · 3.61 KB
/
publish.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
name: publish
on:
push:
branches: [release]
tags:
- v**
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected] # Using the latest version
with:
ref: refs/heads/release
- name: Layout file name
id: naming
env:
GIT_HASH: ${{ github.sha }}
GITHUB_REPO: ${{ github.repository }}
GIT_REF: ${{ github.event.ref }}
GIT_REF_TYPE: ${{ github.ref_type }}
GITHUB_ACTION_EVENT_NAME: ${{ github.event_name }}
GITHUB_IS_PRE_RELEASE: ${{ github.event_name == 'release' && github.event.release.prerelease }}
run: |
CUR_DATE_TIME=$(date +'%Y-%m-%d')
if [ "$GITHUB_ACTION_EVENT_NAME" == "push" ] && [ "$GIT_REF" == "refs/heads/release" ]
then
BUILD_TYPE="Stable"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "push" ] && [[ "$GIT_REF" == "refs/tags/v"* ]]
then
BUILD_TYPE="Release"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "release" ] && [ "$GITHUB_IS_PRE_RELEASE" == "false" ]
then
BUILD_TYPE="Release"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "release" ] && [ "$GITHUB_IS_PRE_RELEASE" == "true" ]
then
BUILD_TYPE="Beta"
else
echo "Unexpected event or condition"
echo "Event name: $GITHUB_ACTION_EVENT_NAME"
echo "Ref: $GIT_REF"
echo "Ref type: $GIT_REF_TYPE"
echo "Is pre-release: $GITHUB_IS_PRE_RELEASE"
exit 1
fi
echo "output_name=Adonis_${BUILD_TYPE}_${GITHUB_REF#refs/*/}_$CUR_DATE_TIME" >> "$GITHUB_OUTPUT"
- uses: ok-nick/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set DebugMode off
run: sed -i "s/DebugMode = true/DebugMode = false/g" Loader/Loader/Loader.server.luau
- name: Set NightlyMode off
run: sed -i "s/NightlyMode = true/NightlyMode = false/g" Loader/Loader/Loader.server.luau
- name: Build Standalone
run: rojo build -o ${{ steps.naming.outputs.output_name }}.rbxm .github/build.project.json
- uses: actions/[email protected]
with:
name: ${{ steps.naming.outputs.output_name }}
path: ${{ steps.naming.outputs.output_name }}.rbxm
- name: Build Loader
run: rojo build -o loader.rbxm .github/loader.deploy.project.json
- name: Build MainModule
run: rojo build -o module.rbxm .github/module.deploy.project.json
- name: Send Standalone Release to Discord channel
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.RELEASE_WEBHOOK }}
filename: ${{ steps.naming.outputs.output_name }}.rbxm
- name: Publish Loader
uses: fjogeleit/[email protected]
with:
url: "${{ secrets.PUBURL2 }}/?assetId=${{ secrets.LOADER_ID }}"
method: "POST"
contentType: "multipart/form-data"
files: '{ "file": "loader.rbxm" }'
customHeaders: '{ "upload-secret": "${{ secrets.PUBURL2_SECRET }}" }'
timeout: 10000
- name: Publish Module
uses: fjogeleit/[email protected]
with:
url: "${{ secrets.PUBURL2 }}/?assetId=${{ secrets.MODULE_ID }}"
method: "POST"
contentType: "multipart/form-data"
files: '{ "file": "module.rbxm" }'
customHeaders: '{ "upload-secret": "${{ secrets.PUBURL2_SECRET }}" }'
timeout: 10000