mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Migrate build system from Webpack to Parcel (#1102)
* Migrate webpack to parcel * Always colour shell output * Fix typos * Fix updateImage function having undefined editorInstance * Readd webpack for deployment builds (licence checker) * Only use webpack for license generation * Re add typscript support * Fix cloudlare deploy * Bump wasm-pack version * Update ci script * Print versions in ci script * Use optional-dependencies for wasm-pack * Execute wget after rust install * Finding wasm-opt version * Print wasm-opt version * Revert test? * Try to revert * Deploy cloudflare via github actions * Fix indentation in ci script * Change project to graphite-dev * Trigger ci * Parcel ci (#1152) * CI Test * Add write permissions for pr * Manually add cloudflare ci comment to prs * Unskip cargo about * Make compile on new versions of npm * Add deployment script to rebuild editor.graphite.rs on tag creation * Remove deploy script * Comment out unused Svelte props causing warnings * Many small fixes, including fixing @ imports --------- Co-authored-by: hypercube <0hypercube@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
c814abc347
commit
e6216009ee
29 changed files with 4532 additions and 7616 deletions
45
.github/workflows/ci.yml
vendored
45
.github/workflows/ci.yml
vendored
|
|
@ -13,6 +13,10 @@ env:
|
|||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
pull-requests: write
|
||||
env:
|
||||
RUSTC_WRAPPER: /usr/bin/sccache
|
||||
CARGO_INCREMENTAL: 0
|
||||
|
|
@ -20,6 +24,20 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Comment deploy start
|
||||
if: github.event_name != 'push'
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
message-id: cloudflare-deploy
|
||||
message: |
|
||||
### <span aria-hidden="true">🚧</span> Deploy Preview building...
|
||||
|
||||
| Name | Link |
|
||||
|---------------------------------|------------------------|
|
||||
|<span aria-hidden="true">🔨</span> Latest commit | ${{ github.sha }} |
|
||||
|<span aria-hidden="true">🔍</span> Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
|
||||
---
|
||||
|
||||
- name: 🔧 Set up Node
|
||||
uses: actions/setup-node@v1
|
||||
|
|
@ -40,11 +58,36 @@ jobs:
|
|||
- name: 🌐 Build Graphite web code
|
||||
env:
|
||||
NODE_ENV: production
|
||||
SKIP_CARGO_ABOUT: true
|
||||
run: |
|
||||
cd frontend
|
||||
mold -run npm run build
|
||||
|
||||
- name: Publish
|
||||
id: cloudflare
|
||||
uses: cloudflare/pages-action@1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: graphite-dev # e.g. 'my-project'
|
||||
directory: frontend/dist # e.g. 'dist'
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Comment deploy url
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
||||
message-id: cloudflare-deploy
|
||||
message: |
|
||||
### <span aria-hidden="true">✅</span> Deploy Preview ready!
|
||||
|
||||
|
||||
| Name | Link |
|
||||
|---------------------------------|------------------------|
|
||||
|<span aria-hidden="true">🔨</span> Latest commit | ${{ github.sha }} |
|
||||
|<span aria-hidden="true">🔍</span> Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
|
||||
|<span aria-hidden="true">😎</span> Deploy Preview Url | [${{ steps.cloudflare.outputs.url }}](${{ steps.cloudflare.outputs.url }}) |
|
||||
|<span aria-hidden="true">🌳</span> Environment | ${{ steps.cloudflare.outputs.environment }} |
|
||||
---
|
||||
|
||||
- name: 👕 Lint Graphite web formatting
|
||||
env:
|
||||
NODE_ENV: production
|
||||
|
|
|
|||
56
.github/workflows/deploy.yml
vendored
Normal file
56
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
name: Deploy release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'latest-stable'
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
env:
|
||||
RUSTC_WRAPPER: /usr/bin/sccache
|
||||
CARGO_INCREMENTAL: 0
|
||||
SCCACHE_DIR: /var/lib/github-actions/.cache
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: 🔧 Set up Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '16.x'
|
||||
|
||||
- name: 🚧 Install Node dependencies
|
||||
run: |
|
||||
cd frontend
|
||||
npm ci
|
||||
|
||||
- name: 🔼 Update Rust to latest stable
|
||||
run: |
|
||||
rustc --version
|
||||
rustup update stable
|
||||
rustc --version
|
||||
|
||||
- name: 🌐 Build Graphite web code
|
||||
env:
|
||||
NODE_ENV: production
|
||||
run: |
|
||||
cd frontend
|
||||
mold -run npm run build
|
||||
|
||||
- name: Publish
|
||||
id: cloudflare
|
||||
uses: cloudflare/pages-action@1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
projectName: graphite-editor
|
||||
directory: frontend/dist
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue