-
Notifications
You must be signed in to change notification settings - Fork 6
93 lines (83 loc) · 2.95 KB
/
releasePackSquash.yaml
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
name: Release Workflow with pack squash
# Controls when the workflow will run
on:
# # Triggers the workflow on push or pull request events but only for the "master" branch
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# build:
# permissions: write-all
# runs-on: ubuntu-latest
#
# steps:
# # Checks-out the repository on master branch
# - uses: actions/checkout@master
#
# - name: Get current date
# id: date
# run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
#
# - name: Get current date
# id: tag
# run: echo "tag=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
#
# - name: Set release name
# run: echo "RELEASE_NAME=HBCubemonde_${{env.date}}" >> $GITHUB_ENV
#
# # Create a zip
# - name: Compress the pack as zip
# uses: TheDoctor0/[email protected]
# with:
# type: 'zip'
# filename: "${{env.RELEASE_NAME}}.zip"
# exclusions: '*.git*'
#
# # Create a new release
# - name: Create Release
# uses: ncipollo/[email protected]
# with:
# name: ${{env.RELEASE_NAME}}
# tag: ${{env.tag}}
# artifacts: "${{env.RELEASE_NAME}}.zip"
# token: ${{ secrets.GITHUB_TOKEN }}
packsquash:
name: Optimize resource pack
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Get current date
id: tag
run: echo "tag=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Set release name
run: echo "RELEASE_NAME=HBCubemonde_${{env.date}}" >> $GITHUB_ENV
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # A non-shallow repository clone is required
- name: Run PackSquash
uses: ComunidadAylas/PackSquash-action@v4
with:
packsquash_version: latest
options: |
# Optimize the pack in the root repository directory.
# This is the default value for pack_directory when no PackSquash options are defined
pack_directory = '.'
# Set a custom output file path to work with the generated ZIP file
# without needing to download its artifact in a separate step
output_file_path = "/tmp/${{env.RELEASE_NAME}}.zip"
allow_mods = ['OptiFine']
# Temporary removing .properties processing because of accentued character encoding
['**/?*.properties']
minify_properties = false
- name: Tag and create release
uses: softprops/action-gh-release@v1
with:
tag_name: action-v${{ github.run_number }}
files: /tmp/${{env.RELEASE_NAME}}.zip