-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (117 loc) · 4.5 KB
/
release_beta.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
name: Publish release (beta)
on:
push:
tags:
- 'v*-beta*'
- 'v*-alpha*'
workflow_dispatch:
permissions:
contents: read
jobs:
upload-normal:
name: Create non-optimized datapack
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Clone repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
with:
fetch-depth: 0
- name: Check commands
uses: mcbeet/check-commands@03cff79228a0a50fe6856becd7972112e326e922
with:
source: .
minecraft: 1.18
- name: Check JSON
uses: ocular-d/json-linter@7d3716a34bcd6fcc5b3b38141a21b9e02da6531d
- name: Upload artifact
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
with:
path: |
assets/
data/
pack.mcmeta
pack.png
name: muffinhunt-datapack v2.0.0-alpha2
upload-optimized-datapack:
permissions:
actions: read # for ComunidadAylas/PackSquash-action to get latest artifact
name: Optimize datapack
runs-on: ubuntu-latest
needs: upload-normal
steps:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Download normal pack
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
with:
name: muffinhunt-datapack v2.0.0-alpha2
path: ./
- name: Run PackSquash
uses: ComunidadAylas/PackSquash-action@5e0e65b4a8d89735b64e0f20564179ed3dc7855f
with:
path: ./
token: ${{ secrets.GITHUB_TOKEN }}
minify_json_files: true
validate_pack_metadata_file: true
allow_optifine_mod: true
delete_bloat_json_keys: true
artifact_name: 'optimized-muffinhunt-datapack v2.0.0-alpha2'
never_store_squash_times: true
create-release:
permissions:
contents: write # for softprops/action-gh-release to create GitHub release
issues: read # for heinrichreimer/github-changelog-generator-action to fetch issues and labels
pull-requests: read # for heinrichreimer/github-changelog-generator-action to fetch PRs and labels
name: Create release
needs: [upload-normal,upload-optimized-datapack]
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ebacdc22ef6c2cfb85ee5ded8f2e640f4c776dd5
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Checkout repo
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
with:
token: ${{ secrets.GH_TOKEN }}
- name: Generate release changelog
uses: heinrichreimer/github-changelog-generator-action@6f5b9494dd265d6fb7243a10c53dc0169c55f247
with:
token: ${{ secrets.GITHUB_TOKEN }}
dateFormat: '%m/%d/%Y'
- name: Download normal pack
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
with:
name: muffinhunt-datapack v2.0.0-alpha2
- name: Zip pack
run: zip 'muffinhunt-datapack v2.0.0-alpha2' -r data pack.mcmeta pack.png
- name: Delete datapack
run: rm -r data pack.mcmeta pack.png
- name: Download optimized pack
uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7
with:
name: optimized-muffinhunt-datapack v2.0.0-alpha2
- name: Zip optimized pack
run: |
unzip -f pack.zip
zip -r 'optimized-muffinhunt-datapack v2.0.0-alpha2' . -i data pack.mcmeta pack.png
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: |
*.zip
body_path: CHANGELOG.md
- name: Commit changes
run: |
echo ${GITHUB_REF#refs/*/}
git config --local user.name "actions-user"
git config --local user.email "action@github.com"
git add CHANGELOG.md
git commit -m "[ci skip] Updated CHANGELOG.md for ${{ github.ref }}"
git push origin HEAD:master