Improve release workflow with installation script and better instruct… #6
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 and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Only trigger when tags like v1.0.0 are pushed | |
| jobs: | |
| build-and-release: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: app/package-lock.json | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| cache-dependency-path: | | |
| server/requirements.txt | |
| - name: Install Python dependencies | |
| run: | | |
| cd server | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install Node.js dependencies | |
| run: | | |
| cd app | |
| npm ci | |
| # Create .env file with secrets | |
| - name: Create .env file | |
| run: | | |
| cd app | |
| echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" > .env | |
| echo "Created .env file with API key" | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Build App | |
| run: | | |
| cd app | |
| npm run dist:mac | |
| - name: Package App | |
| run: | | |
| cd app/dist | |
| # List directories to see what was created | |
| ls -la | |
| # Find the mac build directory (could be mac, mac-arm64, mac-universal, etc.) | |
| MAC_DIR=$(find . -name "mac*" -type d | head -1) | |
| echo "Found Mac directory: $MAC_DIR" | |
| cd "$MAC_DIR" | |
| # Create installation script | |
| cat > install-tether.sh << 'EOF' | |
| #!/bin/bash | |
| echo "Installing Tether..." | |
| echo "Removing quarantine attributes..." | |
| xattr -cr Tether.app | |
| echo "Moving to Applications folder..." | |
| mv Tether.app /Applications/ | |
| echo "Done! You can now run Tether from your Applications folder." | |
| EOF | |
| chmod +x install-tether.sh | |
| # Find the .app directory and zip it with the install script | |
| APP_NAME=$(find . -name "*.app" -type d | head -1) | |
| zip -r "Tether-v${{ steps.get_version.outputs.VERSION }}-mac.zip" "$APP_NAME" install-tether.sh | |
| # Move zip to parent dist directory for easier access | |
| mv "Tether-v${{ steps.get_version.outputs.VERSION }}-mac.zip" ../ | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Release v${{ steps.get_version.outputs.VERSION }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| body: | | |
| ## Installation Instructions | |
| ### For macOS Users: | |
| **Easy Installation (Recommended):** | |
| 1. Download the `Tether-v${{ steps.get_version.outputs.VERSION }}-mac.zip` file below | |
| 2. Double-click to extract the zip file | |
| 3. Double-click `install-tether.sh` script (it will handle everything automatically) | |
| 4. Run Tether from your Applications folder! | |
| **Manual Installation:** | |
| 1. Download and extract the zip file | |
| 2. Open Terminal and run: `xattr -cr Tether.app` (removes quarantine) | |
| 3. Move `Tether.app` to your Applications folder | |
| 4. Double-click to run | |
| **If you still get warnings:** | |
| - Right-click Tether.app → "Open" → "Open" when the warning appears | |
| - Or go to System Preferences → Security & Privacy → General → Click "Open Anyway" | |
| **Note:** The app is unsigned, which causes macOS security warnings. The `xattr` command removes the quarantine flag that prevents unsigned apps from running. | |
| ### What's New: | |
| See the auto-generated release notes below. | |
| files: | | |
| app/dist/*.zip | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set release visibility to public | |
| run: | | |
| gh api \ | |
| --method PATCH \ | |
| -H "Accept: application/vnd.github+json" \ | |
| /repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }} \ | |
| -f private=false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |