Skip to content

Commit

Permalink
feat: add nativefier action
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Jun 7, 2024
1 parent e16136e commit 298db34
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Create Monopoly App with Nativefier

on:
push:
# branches:
# - main

jobs:
build:
name: Build Nativefier Apps
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install Nativefier
run: npm install -g nativefier

- name: Get version from pyproject.toml
id: get-version
run: |
version=$(grep -m 1 version pyproject.toml | awk -F' = ' '{print $2}' | tr -d '"')
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Create Monopoly App
run: |
nativefier --name 'monopoly' 'https://monopoly.streamlit.app/' --platform '${{ matrix.platform }}'
- name: Upload Monopoly App Artifact
uses: actions/upload-artifact@v2
with:
name: monopoly-${{ matrix.os }}-${{ steps.get_version.outputs.version }}
path: ./monopoly-${{ matrix.os }}-x64

- name: Zip Artifacts
run: |
zip -r monopoly-${{ matrix.platform }}-${{ steps.get_version.outputs.version }}.zip ./monopoly-${{ matrix.platform }}-x64
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: Release ${{ steps.get_version.outputs.version }}
draft: false
prerelease: false

- name: Upload Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./monopoly-${{ matrix.platform }}-${{ steps.get_version.outputs.version }}.zip
asset_name: monopoly-${{ matrix.platform }}-${{ steps.get_version.outputs.version }}.zip
asset_content_type: application/zip

0 comments on commit 298db34

Please sign in to comment.