v1.0.0-alpha.0 #1
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: Release-Linux | |
on: | |
push: | |
tags: | |
- "v*.*.*" # 监听所有以 'v' 开头的标签 | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: "Tag to release" | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
architecture: [x64, arm64] # 添加架构 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Verify Python Version | |
run: python --version | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Set Yarn Version | |
run: corepack prepare yarn | |
- name: Install dependencies | |
run: yarn install | |
- name: Lint code | |
run: | | |
yarn lint || (echo "Linting issues found, trying to fix..." && yarn lint-fix) | |
- name: Build the project for x64 | |
if: matrix.architecture == 'x64' | |
run: yarn make --arch=x64 --verbose | |
- name: Build the project for arm64 | |
if: matrix.architecture == 'arm64' | |
run: yarn make --arch=arm64 --verbose | |
- name: Find built assets RPM | |
id: find_assets_rpm | |
run: | | |
ASSET_PATH=$(find ./out/make -path './node_modules' -prune -o -name '*.rpm' -print | head -n 1) | |
ABSOLUTE_ASSET_PATH=$(realpath "$ASSET_PATH") | |
echo "ASSET_RPM_PATH=$ABSOLUTE_ASSET_PATH" >> $GITHUB_ENV | |
BASENAME=$(basename "$ASSET_PATH") | |
echo "ASSET_RPM_BASENAME=$BASENAME" >> $GITHUB_ENV | |
shell: bash | |
- name: Find built assets DEB | |
id: find_assets_deb | |
run: | | |
ASSET_PATH=$(find ./out/make -path './node_modules' -prune -o -name '*.deb' -print | head -n 1) | |
ABSOLUTE_ASSET_PATH=$(realpath "$ASSET_PATH") | |
echo "ASSET_DEB_PATH=$ABSOLUTE_ASSET_PATH" >> $GITHUB_ENV | |
BASENAME=$(basename "$ASSET_PATH") | |
echo "ASSET_DEB_BASENAME=$BASENAME" >> $GITHUB_ENV | |
shell: bash | |
- name: Upload Artifacts RPM | |
id: upload-artifact-rpm | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ASSET_RPM_BASENAME }} | |
path: ${{ env.ASSET_RPM_PATH }} | |
overwrite: true | |
- name: Upload Artifacts DEB | |
id: upload-artifact-deb | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ASSET_DEB_BASENAME }} | |
path: ${{ env.ASSET_DEB_PATH }} | |
overwrite: true | |
- name: Create and Upload Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }} | |
name: ${{ github.event.inputs.tag_name || github.ref_name }} | |
files: ${{ env.ASSET_RPM_PATH }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and Upload Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.inputs.tag_name || github.ref_name }} | |
name: ${{ github.event.inputs.tag_name || github.ref_name }} | |
files: ${{ env.ASSET_DEB_PATH }} | |
token: ${{ secrets.GITHUB_TOKEN }} |