-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (82 loc) · 2.52 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
88
name: Create Builds
on:
push:
paths:
- 'datapacks/Skyblock CE datapacks/data/skyblock/function/versions/changelog/building_version.json'
jobs:
check_changes:
runs-on: ubuntu-24.04
outputs:
release_changed: ${{ steps.check.outputs.release_changed }}
nightly_changed: ${{ steps.check.outputs.nightly_changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get file changes
id: changed-files
run: |
DIFF=$(git diff HEAD^ HEAD -- "datapacks/Skyblock CE datapacks/data/skyblock/function/versions/changelog/building_version.json")
echo "diff<<EOF" >> $GITHUB_OUTPUT
echo "$DIFF" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Check changes
id: check
run: |
DIFF="${{ steps.changed-files.outputs.diff }}"
if echo "$DIFF" | grep -q '"Release Building"'; then
echo "release_changed=true" >> $GITHUB_OUTPUT
else
echo "release_changed=false" >> $GITHUB_OUTPUT
fi
if echo "$DIFF" | grep -q '"Nightly Building"'; then
echo "nightly_changed=true" >> $GITHUB_OUTPUT
else
echo "nightly_changed=false" >> $GITHUB_OUTPUT
fi
release_build:
needs: check_changes
if: needs.check_changes.outputs.release_changed == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Upload release content
uses: actions/upload-artifact@v4
with:
name: Skyblock_CE_Latest
path: |
datapacks/**/*
!.git/**
!.github/**
!.gitignore
!.worlds/**
!Resources Pack/**
!crowdin.yml
!spyglass.json
!*.zip
!.DS_Store
if-no-files-found: error
retention-days: 90
nightly_build:
needs: check_changes
if: needs.check_changes.outputs.nightly_changed == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Upload nightly content
uses: actions/upload-artifact@v4
with:
name: Skyblock_CE_Nightly_Snapshots
path: |
datapacks/**/*
!.git/**
!.github/**
!.gitignore
!.worlds/**
!Resources Pack/**
!crowdin.yml
!spyglass.json
!*.zip
!.DS_Store
if-no-files-found: error
retention-days: 90