-
-
Notifications
You must be signed in to change notification settings - Fork 17
221 lines (187 loc) · 7.89 KB
/
rust-staging-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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
###
### Copyright (c) 2024 Carbon Community
### All rights reserved
###
name: Rust (Staging) Build
concurrency: build-rust-staging
on:
workflow_dispatch:
schedule:
- cron: "00 19 * * *"
jobs:
bootstrap:
name: 🥾 Bootstrap
runs-on: ubuntu-latest
outputs:
date: ${{ steps.step1.outputs.date }}
clock: ${{ steps.step1.outputs.clock }}
tag: ${{ steps.step1.outputs.tag }}
ref: ${{ steps.step1.outputs.ref }}
wipe: ${{ steps.step1.outputs.wipe }}
version: ${{ steps.step1.outputs.version }}
steps:
#- name: Log environment
# uses: crazy-max/ghaction-dump-context@v1
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
with:
ref: rust_beta/staging
- name: 📅 Prepare the environment
id: step1
run: |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "clock=$(date +'%H:%M:%S')" >> $GITHUB_OUTPUT
echo "tag=$(date +'%Yd%j')" >> $GITHUB_OUTPUT
echo "ref=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "wipe=$( [ $(date +%u) -eq 4 ] && [ $(date +%d) -le 7 ] && echo true || echo false )" >> $GITHUB_OUTPUT
echo "version=2.3.$(curl -s -L 'https://carbonmod.gg/version?id=staging&token=${{secrets.VERSIONS_TOKEN}}')" >> $GITHUB_OUTPUT
# BUILD LINUX ----------------------------------------------------------------
build-linux:
name: 🐧 Linux
needs: bootstrap
runs-on: ubuntu-20.04
continue-on-error: true
outputs:
wipe: ${{ needs.bootstrap.outputs.wipe }}
artifact: build-staging-${{ needs.bootstrap.outputs.ref }}-linux
build_info: Built at ${{ needs.bootstrap.outputs.date }} ${{ needs.bootstrap.outputs.clock }} based on commit ${{ needs.bootstrap.outputs.ref }}.
steps:
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
with:
ref: rust_beta/staging
token: ${{ secrets.PAT_ALL_REPO }}
submodules: recursive
- name: 🛤️ Setup the dotnet build environment
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- uses: dtolnay/rust-toolchain@stable
- uses: ClementTsang/cargo-action@v0.0.3
with:
command: build
args: -r --target x86_64-unknown-linux-gnu
directory: Carbon.Core/Carbon.Native
- name: 🔨 Setup the Carbon build environment
shell: bash
run: |
${GITHUB_WORKSPACE}/Tools/Build/linux/bootstrap.sh
- name: 🔨 Setup the Carbon build environment (Staging)
shell: bash
run: |
${GITHUB_WORKSPACE}/Tools/Build/linux/update_staging.sh
- name: 🐧 Built Carbon on Linux
shell: bash
run: |
export VERSION=${{ needs.bootstrap.outputs.version }}
${GITHUB_WORKSPACE}/Tools/Build/linux/build.sh DebugUnix RUST_STAGING "rustbeta_staging"
${GITHUB_WORKSPACE}/Tools/Build/linux/build.sh MinimalUnix RUST_STAGING "rustbeta_staging"
- name: ⬆️ Upload the artifacts
uses: actions/upload-artifact@v3
with:
name: build-staging-linux
path: |
Release/Carbon.Linux.Debug.tar.gz
Release/Carbon.Linux.Debug.info
Release/Carbon.Linux.Minimal.tar.gz
Release/Carbon.Linux.Minimal.info
# BUILD WINDOWS --------------------------------------------------------------
build-windows:
name: 💻 Windows
needs: bootstrap
runs-on: windows-latest
continue-on-error: true
steps:
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
with:
ref: rust_beta/staging
token: ${{ secrets.PAT_ALL_REPO }}
submodules: recursive
- name: 🛤️ Setup the dotnet build environment
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- uses: dtolnay/rust-toolchain@stable
- uses: ClementTsang/cargo-action@v0.0.3
with:
command: build
args: -r --target x86_64-pc-windows-msvc
directory: Carbon.Core/Carbon.Native
- name: 🔨 Setup the Carbon build environment
shell: cmd
run: |
%GITHUB_WORKSPACE%\Tools\Build\win\bootstrap.bat
- name: 🔨 Setup the Carbon build environment (Staging)
shell: cmd
run: |
%GITHUB_WORKSPACE%\Tools\Build\win\update_staging.bat
- name: 🔨 Built Carbon on Windows
shell: cmd
run: |
set VERSION=${{ needs.bootstrap.outputs.version }}
call %GITHUB_WORKSPACE%\Tools\Build\win\build.bat Debug RUST_STAGING rustbeta_staging
call %GITHUB_WORKSPACE%\Tools\Build\win\build.bat Minimal RUST_STAGING rustbeta_staging
- name: ⬆️ Upload the artifacts
uses: actions/upload-artifact@v3
with:
name: build-staging-windows
path: |
Release/Carbon.Windows.Debug.zip
Release/Carbon.Windows.Debug.info
Release/Carbon.Windows.Minimal.zip
Release/Carbon.Windows.Minimal.info
# RELEASE --------------------------------------------------------------------
release-on-schedule:
name: 💾 Rust (Staging) Release
needs: ["bootstrap", "build-linux", "build-windows"]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
# only release if triggered by the scheduler
# or if manually triggered by a developer
steps:
- name: 🗑️ Delete existing release tag
uses: dev-drprasad/delete-tag-and-release@92d94d77429cb0436597047a92369526a5824f50
with:
delete_release: true
tag_name: rustbeta_staging_build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 💤 Sleep for 5 seconds
run: sleep 5s
shell: bash
- name: ⬇️ Download artifacts
uses: actions/download-artifact@v3
with:
path: Release
- name: Display structure of downloaded files
run: ls -R
working-directory: Release
- name: 🏷️ Update release tag
uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b
with:
draft: false
prerelease: true
tag_name: rustbeta_staging_build
name: "Rust (Staging) Build — v${{ needs.bootstrap.outputs.version }}"
body: |
This is a manually triggered development build of Carbon based on the `rust_beta/staging` branch.
This build might and probably will be very unstable and its sole purpose is for testing and/or exploring Rust's future update features in a modded environment.
This build is targeted at developers or testers.
The general public is advised to use one of the [stable] builds.
Since it's manually triggered, we're confident you should use this build to test out the latest Carbon changes.
### How to install
1. Download the `Carbon.[Windows|Linux].Debug` archive from the attachments below.
2. Unzip the archive to the root of your Rust Dedicated Server.
3. Restart the server and enjoy.
${{ needs.build-linux.outputs.build_info }}
[stable]: https://github.com/CarbonCommunity/Carbon.Core/releases/latest
files: |
Release/build-staging-linux/Carbon.Linux.Debug.info
Release/build-staging-linux/Carbon.Linux.Debug.tar.gz
Release/build-staging-windows/Carbon.Windows.Debug.info
Release/build-staging-windows/Carbon.Windows.Debug.zip
Release/build-staging-linux/Carbon.Linux.Minimal.info
Release/build-staging-linux/Carbon.Linux.Minimal.tar.gz
Release/build-staging-windows/Carbon.Windows.Minimal.info
Release/build-staging-windows/Carbon.Windows.Minimal.zip