feat: add nativefier action #1
This file contains 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: 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 |