maybe explicit build but using npm #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build/release | |
on: push | |
jobs: | |
release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v1 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
# - name: Install MSYS2 | |
# if: matrix.os == 'windows-latest' | |
# run: | | |
# choco install msys2 --confirm | |
# - name: Update MSYS2 packages | |
# if: matrix.os == 'windows-latest' | |
# run: | | |
# echo "C:\\tools\\msys64\\usr\\bin" >> $GITHUB_PATH | |
# C:\\tools\\msys64\\usr\\bin\\bash.exe -lc "pacman -Syu --noconfirm" | |
# - name: Install GTK+ | |
# if: matrix.os == 'windows-latest' | |
# uses: nick-fields/retry@v2 | |
# with: | |
# timeout_minutes: 5 | |
# max_attempts: 3 | |
# command: | | |
# echo "C:\\tools\\msys64\\usr\\bin" >> $GITHUB_PATH | |
# C:\\tools\\msys64\\usr\\bin\\bash.exe -lc "pacman -S mingw-w64-ucrt-x86_64-gtk3 --noconfirm" | |
# - name: Set GTK_HOME environment variable | |
# if: matrix.os == 'windows-latest' | |
# run: echo "GTK_HOME=C:\\tools\\msys64\\mingw64" >> $GITHUB_ENV | |
# - name: Cache node modules | |
# uses: actions/cache@v4 | |
# with: | |
# path: ~/.npm | |
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
# restore-keys: | | |
# ${{ runner.os }}-node- | |
# - name: Retry failed step | |
# uses: nick-fields/retry@v2 | |
# with: | |
# timeout_minutes: 5 | |
# max_attempts: 3 | |
# command: npm i --verbose --no-optional | |
# shell: bash | |
- name: Install Dependencies | |
# run: yarn install --verbose --omit=optional --no-package-lock | |
run: npm install --verbose | |
timeout-minutes: 30 | |
shell: bash | |
# introduce aa delay to help nod7z-archive build | |
- name: delay | |
run: sleep 10 | |
shell: bash | |
- name: delete canvas #https://github.com/mozilla/pdf.js/issues/15652 | |
run: rm -rf node_modules/canvas | |
shell: bash | |
# - name: run build on node7z-archive | |
# run: cd node_modules/node-7z-archive && yarn add tsc && yarn run build node-7z-archive | |
# shell: bash | |
# - name: cd back to home | |
# run: cd ../.. | |
# shell: bash | |
- name: run build on node7z-archive | |
run: cd node_modules/node-7z-archive && npm run build node-7z-archive | |
shell: bash | |
- name: cd back to home | |
run: cd ../.. | |
shell: bash | |
#instead of that we just need to js files from node-7z-archive, nah this wont work they dont exist! | |
# - name: copy js files from node-7z-archive | |
# run: mkdir node_modules/node-7z-archive/lib && cp -r node_modules/node-7z-archive/lib/* node_modules/node-7z-archive/lib | |
# shell: bash | |
- name: Set electron-builder architecture for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo "ELECTRON_BUILDER_ARCH=x64" >> $GITHUB_ENV | |
shell: bash | |
- name: Build/release Electron app for non-macOS | |
if: matrix.os != 'macos-latest' | |
uses: johannesjo/action-electron-builder@v1 | |
with: | |
skip_install: true | |
# args: "--config.win.portable=true" | |
github_token: ${{ secrets.github_token }} | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
env: | |
CSC_IDENTITY_AUTO_DISCOVERY: false | |
- name: Build/release Electron app for macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
npx electron-builder --mac --x64 --publish=${{ startsWith(github.ref, 'refs/tags/v') && 'always' || 'never' }} | |
chmod +r node_modules/node-unar/lsar node_modules/node-unar/unar | |
shell: bash | |
env: | |
CSC_IDENTITY_AUTO_DISCOVERY: false | |
GH_TOKEN: ${{ secrets.github_token }} |