Skip to content

Commit efd142f

Browse files
committed
Update, tidy up, and standardize GitHub Actions workflows
1 parent f7815d0 commit efd142f

15 files changed

+224
-173
lines changed

.github/workflows/build-linux-bundle.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,60 @@
1-
name: Build Linux Bundle
1+
name: "Build Linux Bundle"
22

33
on:
4-
push:
5-
branches:
6-
- master
74
workflow_dispatch:
85
inputs:
96
push_to_cache:
107
description: "Push to Nix Cache"
118
required: false
129
type: boolean
1310
default: false
11+
push:
12+
branches:
13+
- master
1414

1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
permissions:
1919
contents: read
2020
steps:
21-
- uses: actions/checkout@v4
22-
- uses: DeterminateSystems/nix-installer-action@main
21+
- name: 📥 Clone repository
22+
uses: actions/checkout@v4
23+
24+
- name: ❄ Install Nix
25+
uses: DeterminateSystems/nix-installer-action@main
2326

24-
- name: Free disk space
27+
- name: 🗑 Free disk space
2528
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
2629

27-
- name: Build Nix Package
30+
- name: 📦 Build Nix package
2831
run: nix build --no-link --print-out-paths
2932

30-
- name: Push to Nix Cache
33+
- name: 📤 Push to Nix cache
3134
if: github.ref == 'refs/heads/master' || inputs.push_to_cache == true
3235
env:
3336
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN }}
3437
run: |
3538
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
3639
nix build --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
3740
38-
- name: Build Linux Bundle
41+
- name: 🏗 Build Linux bundle
3942
run: nix build .#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
4043

41-
- name: Upload Linux Bundle
44+
- name: 📦 Upload Linux bundle
4245
uses: actions/upload-artifact@v4
4346
with:
4447
name: graphite-linux-bundle
4548
path: graphite-linux-bundle.tar.xz
4649
compression-level: 0
4750

48-
- name: Setup Flatpak Tooling
51+
- name: 🔧 Install Flatpak tooling
4952
run: |
5053
sudo apt-get update
5154
sudo apt-get install -y flatpak flatpak-builder
5255
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
5356
54-
- name: Build Flatpak
57+
- name: 🏗 Build Flatpak
5558
run: |
5659
nix build .#graphite-flatpak-manifest
5760
@@ -67,7 +70,7 @@ jobs:
6770
6871
flatpak build-bundle repo Graphite.flatpak art.graphite.Graphite --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
6972
70-
- name: Upload Flatpak
73+
- name: 📦 Upload Flatpak package
7174
uses: actions/upload-artifact@v4
7275
with:
7376
name: graphite-flatpak

.github/workflows/build-mac-bundle.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Mac Bundle
1+
name: "Build Mac Bundle"
22

33
on:
44
workflow_dispatch: {}
@@ -14,18 +14,18 @@ jobs:
1414
WASM_BINDGEN_CLI_VERSION: "0.2.100"
1515

1616
steps:
17-
- name: Checkout
17+
- name: 📥 Clone repository
1818
uses: actions/checkout@v4
1919

20-
- name: Setup Rust
20+
- name: 🦀 Install Rust
2121
uses: actions-rust-lang/setup-rust-toolchain@v1
2222
with:
2323
toolchain: stable
2424
override: true
2525
rustflags: ""
2626
target: wasm32-unknown-unknown
2727

28-
- name: Cache Cargo
28+
- name: 💾 Set up Cargo cache
2929
uses: actions/cache@v4
3030
with:
3131
path: |
@@ -34,7 +34,7 @@ jobs:
3434
target
3535
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
3636

37-
- name: Setup Node
37+
- name: 🟢 Install Node.js
3838
uses: actions/setup-node@v4
3939
with:
4040
node-version-file: .nvmrc
@@ -43,7 +43,7 @@ jobs:
4343
package-lock.json
4444
frontend/package-lock.json
4545
46-
- name: Install Native Dependencies
46+
- name: 🚧 Install native dependencies
4747
env:
4848
GITHUB_TOKEN: ${{ github.token }}
4949
BINSTALL_DISABLE_TELEMETRY: "true"
@@ -64,25 +64,26 @@ jobs:
6464
cargo binstall --no-confirm --force cargo-about
6565
cargo binstall --no-confirm --force "wasm-bindgen-cli@${WASM_BINDGEN_CLI_VERSION}"
6666
67-
- name: Build Mac Bundle
67+
- name: 🏗 Build Mac bundle
6868
env:
6969
CARGO_TERM_COLOR: always
7070
run: cargo run build desktop
7171

72-
- name: Stage Artifacts
72+
- name: 📁 Stage artifacts
7373
shell: bash
7474
run: |
7575
rm -rf target/artifacts
7676
mkdir -p target/artifacts
7777
cp -R target/release/Graphite.app target/artifacts/Graphite.app
7878
79-
- name: Upload Mac Bundle
79+
- name: 📦 Upload Mac bundle
80+
if: github.ref != 'refs/heads/master'
8081
uses: actions/upload-artifact@v4
8182
with:
8283
name: graphite-mac-bundle
8384
path: target/artifacts
8485

85-
- name: Sign and Notarize Mac Bundle Preparation
86+
- name: 🔏 Sign and notarize (preparation)
8687
if: github.ref == 'refs/heads/master'
8788
env:
8889
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
@@ -116,7 +117,7 @@ jobs:
116117
</plist>
117118
EOF
118119
119-
- name: Sign and Notarize Mac Bundle
120+
- name: 🔏 Sign and notarize
120121
if: github.ref == 'refs/heads/master'
121122
env:
122123
APPLE_EMAIL: ${{ secrets.APPLE_EMAIL }}
@@ -149,7 +150,7 @@ jobs:
149150
150151
spctl -a -vv "$APP_PATH"
151152
152-
- name: Upload Mac Bundle Signed
153+
- name: 📦 Upload signed Mac bundle
153154
if: github.ref == 'refs/heads/master'
154155
uses: actions/upload-artifact@v4
155156
with:
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Nix Package
1+
name: "Build Nix Package"
22

33
on:
44
workflow_dispatch: {}
@@ -9,9 +9,14 @@ jobs:
99
permissions:
1010
contents: read
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: DeterminateSystems/nix-installer-action@main
14-
- uses: DeterminateSystems/magic-nix-cache-action@main
12+
- name: 📥 Clone repository
13+
uses: actions/checkout@v4
1514

16-
- name: Build Nix Package Dev
15+
- name: ❄ Install Nix
16+
uses: DeterminateSystems/nix-installer-action@main
17+
18+
- name: 💾 Set up Nix cache
19+
uses: DeterminateSystems/magic-nix-cache-action@main
20+
21+
- name: 📦 Build Nix package dev
1722
run: nix build .#graphite-dev --print-build-logs

.github/workflows/build-production.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,29 @@ jobs:
2121
INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="editor.graphite.art" data-api="https://graphite.art/visit/event" src="https://graphite.art/visit/script.hash.js"></script>
2222

2323
steps:
24-
- name: 📥 Clone and checkout repository
25-
uses: actions/checkout@v3
24+
- name: 📥 Clone repository
25+
uses: actions/checkout@v4
2626

2727
- name: 🗑 Clear wasm-bindgen cache
2828
run: rm -r ~/.cache/.wasm-pack
2929

30-
- name: 🟢 Install the latest Node.js
30+
- name: 🟢 Install Node.js
3131
uses: actions/setup-node@v4
3232
with:
33-
node-version: "latest"
33+
node-version-file: .nvmrc
3434

3535
- name: 🚧 Install build dependencies
3636
run: |
3737
cd frontend
3838
npm run setup
3939
40-
- name: 🦀 Install the latest Rust
41-
run: |
42-
echo "Initial system version:"
43-
rustc --version
44-
rustup update stable
45-
echo "Latest updated version:"
46-
rustc --version
40+
- name: 🦀 Install Rust
41+
uses: actions-rust-lang/setup-rust-toolchain@v1
42+
with:
43+
toolchain: stable
44+
override: true
45+
rustflags: ""
46+
target: wasm32-unknown-unknown
4747

4848
- name: ✂ Replace template in <head> of index.html
4949
run: |
@@ -55,15 +55,11 @@ jobs:
5555
run: mold -run cargo run build web
5656

5757
- name: 📤 Publish to Cloudflare Pages
58-
id: cloudflare
59-
uses: cloudflare/pages-action@1
60-
with:
61-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
62-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
63-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
64-
projectName: graphite-editor
65-
directory: frontend/dist
66-
branch: master
58+
env:
59+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
60+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
61+
run: |
62+
npx wrangler@3 pages deploy "frontend/dist" --project-name="graphite-editor" --branch="master" --commit-dirty=true
6763
6864
- name: 📦 Upload assets to GitHub release
6965
env:

0 commit comments

Comments
 (0)