Create MCPACK and release #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and Upload .mcpack Archive | |
on: | |
workflow_dispatch: # Triggered manually | |
jobs: | |
zip_and_upload: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the current repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Create the zip file with .mcpack extension | |
- name: Create .zip.mcpack file | |
run: | | |
zip -r "${GITHUB_REPOSITORY##*/}.zip.mcpack" ./* | |
# Step 3: Get the latest release information | |
- name: Get latest release | |
id: get_latest_release | |
uses: dawidd6/action-get-latest-release@v3 | |
# Step 4: Upload the .mcpack file to the latest release | |
- name: Upload .zip.mcpack to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
release_id: ${{ steps.get_latest_release.outputs.id }} | |
asset_path: "${GITHUB_REPOSITORY##*/}.zip.mcpack" | |
asset_name: "${GITHUB_REPOSITORY##*/}.zip.mcpack" | |
asset_content_type: application/zip |