Skip to content

Commit

Permalink
ci: fix windows build + cache (#15)
Browse files Browse the repository at this point in the history
* ci: add dependency caching for builds

- Add Go build cache for Linux, macOS, and Windows
- Add npm dependencies cache for frontend packages
- Cache paths are OS-specific for optimal performance

* fix(ci): add .exe extension to Windows builds
  • Loading branch information
nathabonfim59 authored Dec 22, 2024
1 parent 44ee500 commit e6b62dc
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/wails/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ runs:
- name: Build Windows App
if: inputs.build == 'true' && runner.os == 'Windows' && inputs.nsis == 'false'
working-directory: ${{ inputs.app-working-directory }}
run: wails build --platform ${{inputs.build-platform}} -webview2 ${{inputs.wails-build-webview2}} -o ${{inputs.build-name}} -tags '${{inputs.build-tags}}'
run: wails build --platform ${{inputs.build-platform}} -webview2 ${{inputs.wails-build-webview2}} -o ${{inputs.build-name}}.exe -tags '${{inputs.build-tags}}'
shell: bash
- name: Build Windows App + Installer
if: inputs.build == 'true' && runner.os == 'Windows' && inputs.nsis == 'true'
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/editai-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive

# Cache Go dependencies
- name: Set up Go cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Cache npm dependencies
- name: Set up npm cache
uses: actions/cache@v3
with:
path: |
frontend/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: ./.github/actions/wails
with:
build-name: editai
Expand Down Expand Up @@ -54,6 +76,28 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive

# Cache Go dependencies
- name: Set up Go cache
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Cache npm dependencies
- name: Set up npm cache
uses: actions/cache@v3
with:
path: |
frontend/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: ./.github/actions/wails
with:
build-name: editai
Expand Down Expand Up @@ -85,6 +129,28 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive

# Cache Go dependencies
- name: Set up Go cache
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Cache npm dependencies
- name: Set up npm cache
uses: actions/cache@v3
with:
path: |
frontend\node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: ./.github/actions/wails
with:
build-name: editai
Expand Down

0 comments on commit e6b62dc

Please sign in to comment.