fix(ci): Add permissions for release creation #3
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get version from tag | |
| id: version | |
| run: | | |
| # Extract version from tag (v0.10.0 -> 0.10.0) | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| # Generate random string (20 chars) - using head -c to avoid pipe hang | |
| RANDOM_STR=$(head -c 100 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 20) | |
| echo "random=$RANDOM_STR" >> $GITHUB_OUTPUT | |
| # Create filename | |
| FILENAME="gm${VERSION}_${RANDOM_STR}.zip" | |
| echo "filename=$FILENAME" >> $GITHUB_OUTPUT | |
| - name: Create addon zip | |
| run: | | |
| # Create temp directory with correct addon name | |
| mkdir -p build/graph_monkey | |
| # Copy addon files (exclude dev files) | |
| rsync -av --exclude='.git' \ | |
| --exclude='.github' \ | |
| --exclude='.claude' \ | |
| --exclude='__pycache__' \ | |
| --exclude='*.pyc' \ | |
| --exclude='*.pyo' \ | |
| --exclude='.personal' \ | |
| --exclude='docs' \ | |
| --exclude='CLAUDE.md' \ | |
| --exclude='.gitignore' \ | |
| --exclude='.DS_Store' \ | |
| --exclude='Thumbs.db' \ | |
| ./ build/graph_monkey/ | |
| # Create zip | |
| cd build | |
| zip -r "../${{ steps.version.outputs.filename }}" graph_monkey | |
| cd .. | |
| # Show contents for verification | |
| echo "=== Zip contents ===" | |
| unzip -l "${{ steps.version.outputs.filename }}" | |
| - name: Create Release Draft | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| name: "Graph Monkey v${{ steps.version.outputs.version }}" | |
| files: ${{ steps.version.outputs.filename }} | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |