forked from Epix-Incorporated/Adonis
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 3.23 KB
/
build.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
name: rojo
on:
push:
branches: [master]
tags:
- v**
pull_request:
branches: [master]
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Layout file name
id: naming
env:
GIT_HASH: ${{ github.sha }}
GITHUB_REPO: ${{ github.repository }}
GIT_REF: ${{ github.ref_name }}
GIT_REF_TYPE: ${{ github.ref_type }}
GITHUB_ACTION_EVENT_NAME: ${{ github.event_name }}
GITHUB_IS_PRE_RELEASE: ${{ github.event_name == 'release' && github.event.isPrerelease }}
run: |
CUR_DATE_TIME=$(date +'%Y-%m-%d')
if [ "$GITHUB_ACTION_EVENT_NAME" == "push" ] && [ "$GIT_REF" == "release" ]
then
BUILD_TYPE="DebugStable"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "push" ] && [ "$GIT_REF_TYPE" == "tag" ]
then
BUILD_TYPE="DebugRelease"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "release" ] && [ "$GITHUB_IS_PRE_RELEASE" == "false" ]
then
BUILD_TYPE="DebugRelease"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "release" ] && [ "$GITHUB_IS_PRE_RELEASE" == "true" ]
then
BUILD_TYPE="DebugBeta"
elif [ "$GITHUB_ACTION_EVENT_NAME" == "pull_request" ] || [ "$GITHUB_REPO" != "Epix-Incorporated/Adonis" ]
then
BUILD_TYPE="PRSnapshot"
else
BUILD_TYPE="Nightly"
fi
echo "output_name=Adonis_${BUILD_TYPE}_${CUR_DATE_TIME}_$(git rev-parse --short "$GIT_HASH")" >> $GITHUB_OUTPUT
- uses: ok-nick/setup-aftman@v0.4.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: rojo build -o ${{ steps.naming.outputs.output_name }}.rbxm .github/build.project.json
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ steps.naming.outputs.output_name }}
path: ${{ steps.naming.outputs.output_name }}.rbxm
# The following commands are run for pushes only.
- name: Build Nightly MainModule
if: github.repository == 'Epix-Incorporated/Adonis' && github.event_name == 'push' && github.ref_name == 'master'
run: rojo build -o module.rbxm .github/module.deploy.project.json
- name: Send file nightly build to Discord channel
uses: tsickert/discord-webhook@v6.0.0
if: github.repository == 'Epix-Incorporated/Adonis' && github.event_name == 'push' && github.ref_name == 'master'
with:
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK }}
filename: ${{ steps.naming.outputs.output_name }}.rbxm
- name: Publish Nightly MainModule
uses: fjogeleit/http-request-action@v1.15.4
if: github.repository == 'Epix-Incorporated/Adonis' && github.event_name == 'push' && github.ref_name == 'master'
with:
url: "${{ secrets.PUBURL2 }}/?assetId=${{ secrets.NIGHTLY_MODULE_ID }}"
method: "POST"
contentType: "multipart/form-data"
files: '{ "file": "module.rbxm" }'
customHeaders: '{ "upload-secret": "${{ secrets.PUBURL2_SECRET }}" }'
timeout: 10000
preventFailureOnNoResponse: 'true'