-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 3.29 KB
/
Build ZIP and MCPACK.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: Build a ZIP and MCPACK version
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set variables
run: |
cp "information.txt" tmp.txt
sed -i '2d' information.txt
VERSION=$(sed 's/version: //g' information.txt)
cp "tmp.txt" information.txt
sed -i '1d' information.txt
ISDONE=$(sed 's/done: //g' information.txt)
cp "tmp.txt" information.txt
rm tmp.txt
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build ZIP (main branch)
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'MCPE-Lunar-Client-Crosshair_${{ env.VERSION }}.zip'
exclusions: '*.git* ./build/ README.md report.txt'
if: (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request')
- name: Build ZIP (other branches and pull request)
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'MCPE-Lunar-Client-Crosshair_${{ github.ref_name }}.zip'
exclusions: '*.git* ./build/ README.md report.txt'
if: ${{ github.ref != 'refs/heads/main' }}
- name: Build .MCPACK (main branch)
run: cp MCPE-Lunar-Client-Crosshair_${{ env.VERSION }}.zip MCPE-Lunar-Client-Crosshair_${{ env.VERSION }}.mcpack
if: (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request')
- name: Build .MCPACK (other branches and pull request)
run: cp MCPE-Lunar-Client-Crosshair_${{ github.ref_name }}.zip MCPE-Lunar-Client-Crosshair_${{ github.ref_name }}.mcpack
if: ${{ github.ref != 'refs/heads/main' }}
- name: Upload MCPE LC Crosshair Build Artifacts (main branch)
id: upload_main
uses: actions/upload-artifact@v4
with:
name: MCPE Lunar Client Crosshair (${{ github.ref_name }})
path: |
MCPE-Lunar-Client-Crosshair_${{ env.VERSION }}.zip
MCPE-Lunar-Client-Crosshair_${{ env.VERSION }}.mcpack
if: (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request')
- name: Upload MCPE LC Crosshair Build Artifacts (other branches and pull request)
id: upload_other
uses: actions/upload-artifact@v4
with:
name: MCPE Lunar Client Crosshair (${{ github.ref_name }})
path: |
MCPE-Lunar-Client-Crosshair_${{ github.ref_name }}.zip
MCPE-Lunar-Client-Crosshair_${{ github.ref_name }}.mcpack
if: ${{ github.ref != 'refs/heads/main' }}
publish:
needs: build
if: (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request')
runs-on: ubuntu-latest
steps:
- name: Download MCPE LC Crosshair Build Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.steps.upload_main.with.name }}
- name: "Upload to CurseForge"
uses: itsmeow/curseforge-upload@v3
with:
file_path: MCPE-Lunar-Client-Crosshair_${{ env.VERSION }}.mcpack
game_endpoint: "minecraft-bedrock"
relations: ""
game_versions: ""
project_id: "641472"
token: "${{ secrets.CF_API_TOKEN }}"
if: (env.ISDONE == 'true') && (github.ref == 'refs/heads/main')