mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: v*
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
include:
|
|
- os: macos-latest
|
|
platform: 'mac'
|
|
- os: windows-latest
|
|
platform: 'win'
|
|
- os: ubuntu-latest
|
|
platform: 'linux'
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
npm_config_disturl: https://atom.io/download/electron
|
|
npm_config_target: 15.3.2
|
|
npm_config_runtime: "electron"
|
|
|
|
steps:
|
|
- name: Set git config
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v2.1.2
|
|
with:
|
|
node-version: 14.x
|
|
|
|
- name: Install
|
|
run: |
|
|
yarn install
|
|
node scripts/download-pandoc.js
|
|
|
|
- name: Set env
|
|
if: matrix.platform == 'mac'
|
|
run: |
|
|
echo "APPLEID=${{ secrets.APPLEID }}" >> $GITHUB_ENV
|
|
echo "APPLEIDPASS=${{ secrets.APPLEIDPASS }}" >> $GITHUB_ENV
|
|
echo "CSC_LINK=${{ secrets.CSC_LINK }}" >> $GITHUB_ENV
|
|
echo "CSC_KEY_PASSWORD=${{ secrets.CSC_KEY_PASSWORD }}" >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
run: |
|
|
yarn build
|
|
|
|
- name: Electron-Win-Linux
|
|
if: matrix.platform != 'mac'
|
|
run: |
|
|
yarn run electron-builder --${{ matrix.platform }} -p never | sed 's/identityName=.*$//'
|
|
|
|
- name: Electron-Mac
|
|
if: matrix.platform == 'mac'
|
|
run: |
|
|
yarn run electron-builder --${{ matrix.platform }} --x64 -p never | sed 's/identityName=.*$//'
|
|
mv out/latest-mac.yml out/latest-mac-x64.yml
|
|
cp ./files/*pty.node ./node_modules/node-pty/build/Release/pty.node
|
|
sed -i '' 's/out\/mac\/Yank Note.app/out\/mac-arm64\/Yank Note.app/' electron-builder.json
|
|
yarn run electron-builder --${{ matrix.platform }} --arm64 -p never | sed 's/identityName=.*$//'
|
|
mv out/latest-mac.yml out/latest-mac-arm64.yml
|
|
cat out/latest-mac-arm64.yml out/latest-mac-x64.yml | sed '9,13d' > out/latest-mac.yml
|
|
|
|
- name: GH Release
|
|
uses: softprops/action-gh-release@v0.1.5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
prerelease: true
|
|
files: |
|
|
out/Yank-Note*.*
|
|
out/latest*.yml
|