-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actuall fix actions... Fr this time.
- Loading branch information
1 parent
5b97bc3
commit da61cb6
Showing
2 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,75 @@ | ||
name: rojo | ||
|
||
on: | ||
push: | ||
branches: [master,main] | ||
branches: [main] | ||
tags: | ||
- v** | ||
pull_request: | ||
branches: [master,main] | ||
branches: [main] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
- uses: actions/[email protected] | ||
|
||
- 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: Roblox/setup-foreman@v1 | ||
- uses: ok-nick/setup-[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build | ||
run: rojo build -o Astra_Nightly_${{ steps.date.outputs.date }}.rbxm .github/build.project.json | ||
run: rojo build -o ${{ steps.naming.outputs.output_name }}.rbxm .github/build.project.json | ||
|
||
- uses: actions/upload-artifact@v2 | ||
- uses: actions/upload-artifact@v4.3.6 | ||
with: | ||
name: Astra_Nightly_${{ steps.date.outputs.date }} | ||
path: Astra_Nightly_${{ steps.date.outputs.date }}.rbxm | ||
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 == 'Astra-Corporation/Astra.Admin' && github.event_name == 'push' | ||
if: github.repository == 'Astra-Corporation/Astra.Admin' && 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@v3.0.0 | ||
if: github.repository == 'Astra-Corporation/Astra.Admin' && github.event_name == 'push' | ||
uses: tsickert/discord-webhook@v6.0.0 | ||
if: github.repository == 'Astra-Corporation/Astra.Admin' && github.event_name == 'push' && github.ref_name == 'master' | ||
with: | ||
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK }} | ||
filename: Astra_Nightly_${{ steps.date.outputs.date }}.rbxm | ||
content: "" | ||
filename: ${{ steps.naming.outputs.output_name }}.rbxm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- uses: ok-nick/[email protected] | ||
with: | ||
token: ${{ SECRETS.GITHUB_TOKEN }} | ||
|
||
- name: Cache Roblox Standard Library | ||
id: cache-roblox-std | ||
uses: actions/[email protected] | ||
with: | ||
path: roblox.yml | ||
key: roblox-std | ||
|
||
- name: Check standard roblox library status | ||
id: check-roblox-std | ||
env: | ||
DID_CACHE: ${{steps.cache-roblox-std.outputs.cache-hit}} | ||
run: | | ||
if test -f roblox.yml; then | ||
CUR_ROBLOX_STD_TIMEDATE="$(date +%s -d "$(cat roblox.yml | head -n 1 | grep -oP "\d{4}-\d{2}-\d{2}(?=\s+\d{2}:\d{2}:\d{2})")")" | ||
else | ||
CUR_ROBLOX_STD_TIMEDATE=0 | ||
fi | ||
if [ "$DID_CACHE" == "true" ] | ||
then | ||
if [ "$(($(date +%s)-$CUR_ROBLOX_STD_TIMEDATE))" -ge "604800" ] | ||
then | ||
echo "::notice ::Roblox Standard Library Cache is out of date by 1 week, requiring a refresh of the standard library cache." | ||
echo "should-fetch=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "should-fetch=false" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "should-fetch=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Update standard roblox library | ||
if: steps.check-roblox-std.outputs.should-fetch == 'true' | ||
run: | | ||
selene generate-roblox-std | ||
- name: Lint | ||
run: | | ||
selene ./MainModule ./Loader |