Ready for release v1.0.0 #2
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 DMG | |
| run: | | |
| cd app | |
| npm run dist:mac | |
| - 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 | |
| files: | | |
| app/dist/*.dmg | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| make_latest: true | |
| - 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 }} |