diff --git a/.github/workflows/build-release-asset.yml b/.github/workflows/build-release-asset.yml new file mode 100644 index 0000000..4a055e6 --- /dev/null +++ b/.github/workflows/build-release-asset.yml @@ -0,0 +1,40 @@ +name: Build and attach release asset + +on: + release: + types: [published] + +jobs: + build-macos: + runs-on: macos-latest + permissions: + contents: write + steps: + - name: Checkout release tag + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install pipenv and py2app + run: pip install pipenv py2app + + - name: Install dependencies + run: pipenv install + env: + PIPENV_VENV_IN_PROJECT: 1 + + - name: Build and zip app + run: pipenv run make zip + + - name: Upload zip to release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.release.tag_name }} + files: dist/Offload.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 4b181a5..86c3ead 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,8 @@ The project supports **macOS on Apple Silicon (M1)** and Intel. Python 3.12+ is or `pipenv run python offload/gui.py` - **Build the .app bundle** (macOS): Uses py2app; produces a native arm64 app on Apple Silicon: ```bash - ./compile.sh + make zip # build .app and create dist/Offload.zip + make all # build, zip, copy to website assets and /Applications ``` Or manually: `pipenv run python setup.py py2app`. The built app is in `dist/Offload.app`. diff --git a/compile.sh b/compile.sh deleted file mode 100755 index c571640..0000000 --- a/compile.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Remove old files -rm -rf dist build - -# Compile app -pipenv run python setup.py py2app - -# Zip and copy app to website -zip -r dist/Offload.zip dist/Offload.app -cp dist/Offload.zip ../offload_website/assets/files/Offload.zip - -# Copy to Applications folder -yes | cp -rf dist/Offload.app /Applications/Offload.app