Create MCPACK and release #15
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: Zip and Upload to Release | |
on: | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
zip_and_upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Zip the current directory (excluding .git and .github) | |
run: | | |
zip -r oreui-utilities.zip.mcpack . -x ".git/*" -x ".github/*" | |
- name: Get the latest release ID | |
id: get_release | |
env: | |
PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: | | |
latest_release=$(curl -s -H "Authorization: token $PAT_TOKEN" \ | |
https://api.github.com/repos/faizul726/oreui-utilities/releases/latest) | |
release_id=$(echo "$latest_release" | jq -r '.id') | |
echo "release_id=$release_id" >> $GITHUB_ENV | |
- name: Upload zip to the latest release | |
env: | |
PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: | | |
curl -s -X POST \ | |
-H "Authorization: token $PAT_TOKEN" \ | |
-H "Content-Type: application/zip" \ | |
--data-binary "@oreui-utilities.zip.mcpack" \ | |