Skip to content

feat: Add workflow_dispatch trigger for action #4

feat: Add workflow_dispatch trigger for action

feat: Add workflow_dispatch trigger for action #4

name: Notion Repackaged
on:
push:
branches: [main]
paths:
- 'sources/sources.json'
- '.github/workflows/notion-repackaged.yml'
workflow_dispatch:
jobs:
prepare-sources:
name: Prepare sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Ubuntu dependencies
run: sudo apt-get install -y jq curl libarchive-tools imagemagick
- name: Install npm dependencies
run: sudo npm i -g asar
- name: Download sources
working-directory: scripts
run: bash download-sources.sh
- name: Prepare sources
working-directory: scripts
run: bash prepare-sources.sh
- name: Compress sources into tar.xz
working-directory: work
run: tar -cJf src.tar.xz src
- name: Save sources as artifact
uses: actions/upload-artifact@v4
with:
name: sources
path: work/src.tar.xz
build-app:
name: Build app
needs: [prepare-sources]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Retrieve saved sources
uses: actions/download-artifact@v4
with:
name: sources
- name: Unpack sources archive
run: mkdir work && tar -xf src.tar.xz -C work
- name: Build app
working-directory: scripts
run: bash build-app.sh
- name: Package app
working-directory: scripts
run: bash package-app.sh
- name: Calculate checksum
run: sha256sum notion-app.tar.xz
cleanup:
name: Cleanup artifacts
if: always()
needs: [build-app]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v4
with:
name: sources