81 lines
2.6 KiB
YAML
81 lines
2.6 KiB
YAML
name: Build Enjoy App
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
os:
|
|
type: choice
|
|
description: Choose platform
|
|
options:
|
|
- macos-latest
|
|
- windows-latest
|
|
- ubuntu-latest
|
|
arch:
|
|
type: choice
|
|
description: Choose Arch
|
|
options:
|
|
- x64
|
|
- arm64
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ github.event.inputs.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Get current time
|
|
uses: josStorer/get-current-time@v2
|
|
id: current-time
|
|
with:
|
|
format: YYYYMMDD-HH-mm
|
|
|
|
- uses: actions/cache@v4
|
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
with:
|
|
path: "**/node_modules"
|
|
key: ${{ runner.os }}-{{ github.event.inputs.arch }}-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Install dependencies
|
|
env:
|
|
# It will build arm64 version in x64 runner
|
|
# This env help ffmpeg/ffprobe-static to install the right binary
|
|
npm_config_arch: ${{ github.event.inputs.arch }}
|
|
run: yarn install
|
|
|
|
- name: Install Apple certificate
|
|
if: github.event.inputs.os == 'macos-latest'
|
|
env:
|
|
MACOS_CERTIFICATE_APPLICATION_BASE64: ${{ secrets.MACOS_CERTIFICATE_APPLICATION_BASE64 }}
|
|
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
|
run: ./enjoy/scripts/add-macos-cert.sh
|
|
|
|
- name: Make with Apple Account
|
|
if: github.event.inputs.os == 'macos-latest'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
|
|
PACKAGE_OS_ARCH: ${{ github.event.inputs.arch }}
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
run: yarn run make:enjoy --arch=${{ github.event.inputs.arch }}
|
|
|
|
- name: Make without Apple account
|
|
if: github.event.inputs.os != 'macos-latest'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
|
|
PACKAGE_OS_ARCH: ${{ github.event.inputs.arch }}
|
|
run: yarn run make:enjoy --arch=${{ github.event.inputs.arch }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Enjoy-${{ runner.os }}-${{ github.event.inputs.arch }}-build-${{ steps.current-time.outputs.formattedTime }}
|
|
path: |
|
|
enjoy/out/make/**/*.deb
|
|
enjoy/out/make/**/*.rpm
|
|
enjoy/out/make/**/*.zip
|
|
enjoy/out/make/**/*.exe
|