From cd8cac8ea6dfcb44251bf33b0ead82d7eeb6a53d Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 15:27:41 +0200 Subject: [PATCH 01/10] feat: adds frontend build steps to gh action --- .github/workflows/prod.yml | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 0f4dfc8..45eaeb7 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -9,26 +9,45 @@ on: jobs: build: runs-on: ubuntu-latest - steps: - - name: Checkout code uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-wordl + uses: actions/cache@v4 + with: + path: | + node_modules + ~/.cache/trunk + ~/.cargo + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-wordl - name: Install Rust uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable + + - name: Add Rust target wasm32-unknown-unknown + run: rustup target add wasm32-unknown-unknown + + - name: Install Trunk + run: cargo install trunk + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Tailwind CSS + run: npm install -g tailwindcss + + - name: Build Frontend + working-directory: ./frontend + run: | + trunk build --release - name: Build and test code run: | From 6e8fe31369adb6ae842e8a6cb21d2443566b0233 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 15:28:44 +0200 Subject: [PATCH 02/10] fix: syntax error in gh action file --- .github/workflows/prod.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 45eaeb7..33a7f74 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -14,15 +14,15 @@ jobs: uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v4 - with: - path: | - node_modules - ~/.cache/trunk - ~/.cargo - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-wordl + uses: actions/cache@v4 + with: + path: | + node_modules + ~/.cache/trunk + ~/.cargo + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-wordl - name: Install Rust uses: actions-rs/toolchain@v1 From 9446c8f8bbab95681024596f6cac92789d149e69 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 15:42:17 +0200 Subject: [PATCH 03/10] feat: local tailwindcss setup & more cache --- .github/workflows/prod.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 33a7f74..e56e312 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -17,10 +17,11 @@ jobs: uses: actions/cache@v4 with: path: | - node_modules - ~/.cache/trunk ~/.cargo + ~/.cache/trunk target/ + node_modules + frontend/dist key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-wordl @@ -42,7 +43,7 @@ jobs: node-version: 20 - name: Install Tailwind CSS - run: npm install -g tailwindcss + run: npm install -D tailwindcss - name: Build Frontend working-directory: ./frontend From c3a1752f001976c477d27735651aa158700837b6 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 15:55:21 +0200 Subject: [PATCH 04/10] fix: gh action frontend build --- .github/workflows/prod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index e56e312..42bd0db 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -44,6 +44,7 @@ jobs: - name: Install Tailwind CSS run: npm install -D tailwindcss + working-directory: ./frontend - name: Build Frontend working-directory: ./frontend From 5263e951bffd5f82bd1456cdeea554ad572f0397 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 15:56:38 +0200 Subject: [PATCH 05/10] feat: add .cargo/bin to cache in gh action --- .github/workflows/prod.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 42bd0db..172cd48 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -18,6 +18,7 @@ jobs: with: path: | ~/.cargo + ~/.cargo/bin ~/.cache/trunk target/ node_modules From fd39795ac3828a3559b3ddd01cff54870ce340b2 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 16:06:14 +0200 Subject: [PATCH 06/10] fix: normalizes trailing slashes --- .github/workflows/prod.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 172cd48..d4cb82d 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -17,12 +17,13 @@ jobs: uses: actions/cache@v4 with: path: | - ~/.cargo - ~/.cargo/bin - ~/.cache/trunk + ~/.cargo/ + ~/.cargo/bin/ + ~/.cache/trunk/ target/ - node_modules - frontend/dist + node_modules/ + frontend/node_modules/ + frontend/dist/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-wordl @@ -45,10 +46,10 @@ jobs: - name: Install Tailwind CSS run: npm install -D tailwindcss - working-directory: ./frontend + working-directory: ./frontend/ - name: Build Frontend - working-directory: ./frontend + working-directory: ./frontend/ run: | trunk build --release From da3e513a58652352ee2e11c8a77419c995df4292 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 16:07:35 +0200 Subject: [PATCH 07/10] fix: removes frontend caches --- .github/workflows/prod.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index d4cb82d..74b5410 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -22,8 +22,6 @@ jobs: ~/.cache/trunk/ target/ node_modules/ - frontend/node_modules/ - frontend/dist/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-wordl From 3c050274f9c680222435c5801aa2e93fda3d2223 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 16:12:40 +0200 Subject: [PATCH 08/10] fix: just use npm install --- .github/workflows/prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 74b5410..5fd5528 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -43,7 +43,7 @@ jobs: node-version: 20 - name: Install Tailwind CSS - run: npm install -D tailwindcss + run: npm install working-directory: ./frontend/ - name: Build Frontend From a2762a43cfd42a5355298697df0d3feac4297a05 Mon Sep 17 00:00:00 2001 From: itsscb Date: Fri, 23 Aug 2024 16:22:56 +0200 Subject: [PATCH 09/10] fix: switch back to global tailwindcss setup --- .github/workflows/prod.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 5fd5528..625934d 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -43,8 +43,7 @@ jobs: node-version: 20 - name: Install Tailwind CSS - run: npm install - working-directory: ./frontend/ + run: npm install -g tailwindcss - name: Build Frontend working-directory: ./frontend/ From 78d40f20d7d46b68c009e54c342bb1f4a5922205 Mon Sep 17 00:00:00 2001 From: itsscb Date: Sat, 24 Aug 2024 19:53:29 +0200 Subject: [PATCH 10/10] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f1df327..87ae85a 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -# wordl \ No newline at end of file +# wordl + +Guess a random German word within five rounds. + + +Try it out at [wordl.shuttleapp.rs](https://wordl.shuttleapp.rs). \ No newline at end of file