Skip to content

Commander API Legacy #58

Commander API Legacy

Commander API Legacy #58

Workflow file for this run

name: Upload Release Asset
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Zip the code
run: zip -r source_code.zip . -x *.git* *.github* *.vscode* "*\@types*" *node_modules* .gitignore .mcattributes CNAME package-lock.json
- name: Rename the file
run: |
REPO_NAME=$(echo ${{ github.repository }} | awk -F / '{print $2}')
TAG_NAME=${{ github.event.release.tag_name }}
FILE_NAME=$REPO_NAME-$TAG_NAME.mcpack
mv source_code.zip $FILE_NAME
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.FILE_NAME }}
asset_name: ${{ env.FILE_NAME }}
asset_content_type: application/octet-stream