-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (83 loc) · 3.1 KB
/
packsquash.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
name: Optimize resource pack
on: [push]
jobs:
packsquash:
name: Optimize resource pack
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
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 = 'pack'
# 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/pack.zip'
- name: Delete Old Artifacts
uses: actions/github-script@v6
id: artifact
with:
script: |
const res = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
})
res.data.artifacts
.forEach(({ id }) => {
github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: id,
})
})
- name: Run PackSquash for tweeks
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 = 'tweeks'
# 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/tweeks.zip'
- name: Tag and create release
#uses: softprops/action-gh-release@v2
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
with:
tag_name: action-v${{ github.run_number }}
draft: false
prerelease: false
#with:
# tag_name: action-v${{ github.run_number }}
# files: /tmp/pack.zip
- name: Upload Release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/tweeks.zip
asset_name: tweeks.zip
asset_content_type: application/zip
- name: Upload Release asset2
id: upload-release-asset2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/pack.zip
asset_name: pack.zip
asset_content_type: application/zip