Files
yn/.github/workflows/release.yml
T
2021-12-04 23:43:21 +08:00

77 lines
2.2 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: 11.4.5
npm_config_runtime: "electron"
steps:
- name: Set git config
run: |
git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2.3.3
- 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=.*$//'
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=.*$//'
- 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