Skip to content

fixed?

fixed? #11

Workflow file for this run

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
ssset_content_type: application/zip