Release #4
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*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version number (e.g., 1.0.0)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and Release | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [ -n "${{ inputs.version }}" ]; then | |
| echo "VERSION=${{ inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build Release | |
| run: | | |
| xcodebuild -scheme MiddleDrag \ | |
| -project MiddleDrag.xcodeproj \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| -destination "platform=macOS" \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| build | |
| - name: Create App Zip | |
| run: | | |
| cd build/Build/Products/Release | |
| zip -r MiddleDrag-${{ steps.version.outputs.VERSION }}.zip MiddleDrag.app | |
| mv MiddleDrag-${{ steps.version.outputs.VERSION }}.zip $GITHUB_WORKSPACE/ | |
| - name: Generate SHA256 | |
| id: sha | |
| run: | | |
| SHA=$(shasum -a 256 MiddleDrag-${{ steps.version.outputs.VERSION }}.zip | awk '{print $1}') | |
| echo "SHA256=$SHA" >> $GITHUB_OUTPUT | |
| echo "SHA256: $SHA" | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.version.outputs.VERSION }} | |
| name: MiddleDrag v${{ steps.version.outputs.VERSION }} | |
| body: "## MiddleDrag v${{ steps.version.outputs.VERSION }}\n\n### SHA256\n```\n${{ steps.sha.outputs.SHA256 }}\n```\n\n### Requirements\n- macOS 14.0 or later\n- Accessibility permissions" | |
| files: MiddleDrag-${{ steps.version.outputs.VERSION }}.zip |