Build & Release SusOps #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: Build & Release SusOps | |
| on: | |
| release: | |
| types: | |
| - released | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout default branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.repository.default_branch }} | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build SusOps.app | |
| run: python setup.py py2app | |
| - name: Package .app into zip | |
| working-directory: ./dist | |
| run: zip -r SusOps.zip SusOps.app | |
| - name: Calculate SHA256 | |
| id: sha | |
| working-directory: ./dist | |
| run: echo "sum=$(shasum -a 256 SusOps.zip | awk '{print $1}')" >> $GITHUB_OUTPUT | |
| - name: Determine version | |
| id: version | |
| run: | | |
| tag="${{ github.event.release.tag_name }}" | |
| version="${tag#v}" | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: dist/SusOps.zip | |
| asset_name: SusOps.zip | |
| asset_content_type: application/zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Git actions user | |
| run: | | |
| git config --global user.name "actions-user" | |
| git config --global user.email "actions@github.com" | |
| - name: Bump Homebrew Cask | |
| run: | | |
| brew tap mashb1t/susops | |
| brew bump-cask-pr \ | |
| mashb1t/susops/susops \ | |
| --version ${{ steps.version.outputs.version }} \ | |
| --url "https://github.com/mashb1t/susops-mac/releases/download/v${{ steps.version.outputs.version }}/SusOps.zip" \ | |
| --sha256 "${{ steps.sha.outputs.sum }}" \ | |
| --no-browse --no-fork --no-audit --no-style | |
| env: | |
| HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_PR_TOKEN }} |