ci: add write permissions for github release #16
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: macos-26 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: "26.2" | |
| - name: Install build tools | |
| run: brew install acpica | |
| - name: Bootstrap SDKs | |
| run: bash Scripts/bootstrap.sh | |
| - name: Build all targets | |
| run: | | |
| set -euo pipefail | |
| xcodebuild -project GramSMC.xcodeproj \ | |
| -scheme "GramSMC All" \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| CODE_SIGNING_REQUIRED=NO | |
| - name: Build SSDT | |
| run: | | |
| set -euo pipefail | |
| iasl -ve -tc GramSMC/SSDT-GramSMC.dsl | |
| - name: Assemble artifacts | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| while IFS= read -r -d '' kext; do | |
| name="$(basename "$kext")" | |
| ditto "$kext" "dist/$name" | |
| done < <(find build -type d -name "*.kext" -print0) | |
| while IFS= read -r -d '' app; do | |
| name="$(basename "$app")" | |
| ditto "$app" "dist/$name" | |
| done < <(find build -type d -name "*.app" -print0) | |
| if [[ -f "GramSMC/SSDT-GramSMC.aml" ]]; then | |
| cp "GramSMC/SSDT-GramSMC.aml" "dist/" | |
| fi | |
| if [[ -f "GramSMCDaemon/com.bananz0.GramSMCDaemon.plist" ]]; then | |
| cp "GramSMCDaemon/com.bananz0.GramSMCDaemon.plist" "dist/" | |
| fi | |
| if [[ -f "GramControlCenter/com.bananz0.GramControlCenter.plist" ]]; then | |
| cp "GramControlCenter/com.bananz0.GramControlCenter.plist" "dist/" | |
| fi | |
| daemon_path="$(find build -type f -name "GramSMCDaemon" -print -quit || true)" | |
| if [[ -n "$daemon_path" ]]; then | |
| cp "$daemon_path" "dist/GramSMCDaemon" | |
| fi | |
| if [[ -f "Scripts/install_daemon_app.sh" ]]; then | |
| cp "Scripts/install_daemon_app.sh" "dist/install.sh" | |
| chmod +x "dist/install.sh" | |
| fi | |
| archive_name="GramSMC-${GITHUB_REF_NAME:-dev}.zip" | |
| ditto -c -k --sequesterRsrc --keepParent dist "$archive_name" | |
| echo "ARCHIVE_NAME=$archive_name" >> "$GITHUB_ENV" | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: GramSMC-${{ github.ref_name }} | |
| path: | | |
| dist | |
| ${{ env.ARCHIVE_NAME }} | |
| - name: Publish release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ env.ARCHIVE_NAME }} |