CI: create out directory before running electronPackager #496
Workflow file for this run
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: CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
node-version: ['18', '20', '21'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
# env: | |
# electron-packager (win32 ia32 on macos) https://github.com/electron/electron-packager/pull/449#issuecomment-240508298 | |
# WINEDLLOVERRIDES: 'mscoree,mshtml=' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
# linux dependencies | |
# https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces | |
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
if: matrix.os == 'ubuntu-latest' | |
- run: sudo apt update && sudo apt install -y wine64 && sudo ln -sf /usr/bin/wine /usr/bin/wine64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
- run: wine64 --version | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
- run: sudo add-apt-repository ppa:git-core/ppa -y && sudo apt-get update -q && sudo apt-get install -y git | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '*' | |
# macos dependencies | |
# required for electron-packager | |
# - run: brew update && brew cask install xquartz wine-stable | |
# if: matrix.os == 'macos-latest' && matrix.node-version == '18' | |
# - run: wine64 --version | |
# if: matrix.os == 'macos-latest' && matrix.node-version == '18' | |
- run: brew reinstall git | |
if: matrix.os == 'macos-latest' && matrix.node-version == '*' | |
# windows dependencies | |
# https://github.community/t5/GitHub-Actions/TEMP-is-broken-on-Windows/td-p/30432 | |
- run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV | |
if: matrix.os == 'windows-latest' | |
- run: choco upgrade git | |
if: matrix.os == 'windows-latest' && matrix.node-version == '*' | |
- run: git --version | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Test testy" | |
- run: git config --global protocol.file.allow always # tests use file based submodules see #1539 | |
- run: npm ci | |
- run: npm run lint | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
- run: npm run build | |
- run: npm test | |
# publish artifacts | |
- run: npm pack | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
- run: npm run electronpackage -- --all | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
- run: npm run electronzip | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
- name: Upload npm pack | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit | |
path: ungit-*.tgz | |
retention-days: 7 | |
- name: Upload ungit-darwin-arm64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-darwin-arm64 | |
path: dist/ungit-darwin-arm64.zip | |
retention-days: 7 | |
- name: Upload ungit-darwin-x64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-darwin-x64 | |
path: dist/ungit-darwin-x64.zip | |
retention-days: 7 | |
- name: Upload ungit-linux-arm64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-linux-arm64 | |
path: dist/ungit-linux-arm64.zip | |
retention-days: 7 | |
- name: Upload ungit-linux-armv7l | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-linux-armv7l | |
path: dist/ungit-linux-armv7l.zip | |
retention-days: 7 | |
- name: Upload ungit-linux-x64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-linux-x64 | |
path: dist/ungit-linux-x64.zip | |
retention-days: 7 | |
- name: Upload ungit-win32-arm64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-win32-arm64 | |
path: dist/ungit-win32-arm64.zip | |
retention-days: 7 | |
- name: Upload ungit-win32-ia32 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-win32-ia32 | |
path: dist/ungit-win32-ia32.zip | |
retention-days: 7 | |
- name: Upload ungit-win32-x64 | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ungit-win32-x64 | |
path: dist/ungit-win32-x64.zip | |
retention-days: 7 | |
- name: npm publish | |
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '18' && github.repository == 'FredrikNoren/ungit' && github.ref == 'refs/heads/master' | |
uses: actions/github-script@v7 | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
with: | |
script: | | |
const script = require('./scripts/npmpublish.js') | |
await script({github, context, core, exec}) |