|
| 1 | +name: Manual Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version_type: |
| 7 | + description: 'Version bump type' |
| 8 | + required: true |
| 9 | + default: 'patch' |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - patch |
| 13 | + - minor |
| 14 | + - major |
| 15 | + - prerelease |
| 16 | + custom_version: |
| 17 | + description: 'Custom version (if version_type is custom)' |
| 18 | + required: false |
| 19 | + type: string |
| 20 | + skip_changelog_edit: |
| 21 | + description: 'Skip interactive changelog editing' |
| 22 | + required: false |
| 23 | + default: false |
| 24 | + type: boolean |
| 25 | + |
| 26 | +jobs: |
| 27 | + create-release: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + permissions: |
| 30 | + contents: write |
| 31 | + actions: write |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout code |
| 35 | + uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + fetch-depth: 0 |
| 38 | + |
| 39 | + - name: Setup Python |
| 40 | + uses: actions/setup-python@v4 |
| 41 | + with: |
| 42 | + python-version: '3.11' |
| 43 | + |
| 44 | + - name: Configure Git |
| 45 | + run: | |
| 46 | + git config --local user.email "action@github.com" |
| 47 | + git config --local user.name "GitHub Action" |
| 48 | +
|
| 49 | + - name: Run release script |
| 50 | + run: | |
| 51 | + # Make script executable |
| 52 | + chmod +x scripts/release.sh |
| 53 | +
|
| 54 | + # Run release script with provided inputs |
| 55 | + if [ "${{ github.event.inputs.version_type }}" = "custom" ]; then |
| 56 | + if [ -z "${{ github.event.inputs.custom_version }}" ]; then |
| 57 | + echo "❌ Custom version type requires custom_version input" |
| 58 | + exit 1 |
| 59 | + fi |
| 60 | + ./scripts/release.sh custom "${{ github.event.inputs.custom_version }}" |
| 61 | + else |
| 62 | + ./scripts/release.sh "${{ github.event.inputs.version_type }}" |
| 63 | + fi |
| 64 | +
|
| 65 | + - name: Create release summary |
| 66 | + run: | |
| 67 | + echo "## 🎉 Manual Release Created!" >> $GITHUB_STEP_SUMMARY |
| 68 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 69 | + echo "### 📋 Details:" >> $GITHUB_STEP_SUMMARY |
| 70 | + echo "- **Version Type**: ${{ github.event.inputs.version_type }}" >> $GITHUB_STEP_SUMMARY |
| 71 | + if [ "${{ github.event.inputs.version_type }}" = "custom" ]; then |
| 72 | + echo "- **Custom Version**: ${{ github.event.inputs.custom_version }}" >> $GITHUB_STEP_SUMMARY |
| 73 | + fi |
| 74 | + echo "- **Branch**: $(git branch --show-current)" >> $GITHUB_STEP_SUMMARY |
| 75 | + echo "- **Latest Tag**: $(git describe --tags --abbrev=0)" >> $GITHUB_STEP_SUMMARY |
| 76 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 77 | + echo "### 🔗 Links:" >> $GITHUB_STEP_SUMMARY |
| 78 | + echo "- [Release Page](https://github.com/${{ github.repository }}/releases/latest)" >> $GITHUB_STEP_SUMMARY |
| 79 | + echo "- [Actions](https://github.com/${{ github.repository }}/actions)" >> $GITHUB_STEP_SUMMARY |
0 commit comments