Skip to content

fix

fix #26

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-release:
name: Build Project and Create Release
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/[email protected]
- name: Node
uses: actions/[email protected]
with:
node-version: "20.19.6"
- name: Install
run: npm run install
- name: Build frontend
run: npm run build:frontend
- name: Get version
id: read_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Update version in manifest file
run: |
sed -i '' "s|version=0.0.1|version=${{ steps.read_version.outputs.version }}|" app/manifest
- name: Get changelog
id: read_log
run: |
CHANGELOG=$(jq -r '.changelog' package.json)
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
- name: Update changelog in manifest file
run: |
sed -i '' "s|changelog=changelog|changelog=${{ steps.read_log.outputs.changelog }}|" app/manifest
- name: Build x86 backend
run: npm run build:backend
- name: Update x86 platform in manifest file
run: |
sed -i '' "s|platform=platform|platform=x86|" app/manifest
- name: Build x86 package
run: |
chmod +x ./build/fnpack-1.0.4-darwin-arm64
./build/fnpack-1.0.4-darwin-arm64 build app
- name: Rename x86 package
run: mv code.editor.fpk code.editor.x86.fpk
- name: Build arm backend
run: npm run build:backend:arm
- name: Update arm platform in manifest file
run: |
sed -i '' "s|platform=x86|platform=arm|" app/manifest
- name: Build arm package
run: |
chmod +x ./build/fnpack-1.0.4-darwin-arm64
./build/fnpack-1.0.4-darwin-arm64 build app
- name: Rename arm package
run: mv code.editor.fpk code.editor.arm.fpk
- name: Release
uses: ncipollo/[email protected]
with:
tag: v${{ steps.read_version.outputs.version}}
name: v${{ steps.read_version.outputs.version}}
body: |
[更新日志](https://github.com/FNOSP/App.Bin.CodeEditor/blob/main/CHANGELOG.md)
artifacts: "code.editor.x86.fpk,code.editor.arm.fpk"
token: ${{ secrets.GITHUB_TOKEN }}