Skip to content

优化:测试main构建上传代码部分 #11

优化:测试main构建上传代码部分

优化:测试main构建上传代码部分 #11

Workflow file for this run

name: Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# - os: ubuntu-latest
# arch: [arm64, amd64]
- os: macos-latest
arch: [arm64, amd64]
# - os: windows-latest
# arch: [arm64, amd64]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
# - name: Build Prepare (macOS)
# if: runner.os == 'macOS'
# run: |
# brew install python-setuptools
#
# - name: Install Dependencies
# run: npm install
#
# - name: Build Release Files
# run: npm run build
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set Build Name ( Linux / macOS )
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
DIST_FILE_NAME=${{ runner.os }}-${{ runner.arch }}-v$(date +%Y%m%d_%H%M%S)-${RANDOM}
echo ::add-mask::$DIST_FILE_NAME
echo DIST_FILE_NAME=$DIST_FILE_NAME >> $GITHUB_ENV
- name: Set Build Name ( Windows )
if: runner.os == 'Windows'
shell: pwsh
run: |
$randomNumber = Get-Random -Minimum 10000 -Maximum 99999
$DIST_FILE_NAME = "Windows-X64-v$(Get-Date -Format 'yyyyMMdd_HHmmss')-$randomNumber"
Write-Host "::add-mask::$DIST_FILE_NAME"
echo "DIST_FILE_NAME=$DIST_FILE_NAME" >> $env:GITHUB_ENV
- name: Upload
uses: modstart/github-oss-action@master
with:
key-id: ${{ secrets.OSS_KEY_ID }}
key-secret: ${{ secrets.OSS_KEY_SECRET }}
region: ${{ secrets.OSS_REGION }}
bucket: ${{ secrets.OSS_BUCKET }}
timeout: 3600
assets: |
dist-release/*.exe:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
dist-release/*.dmg:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
dist-release/*.AppImage:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
dist-release/*.deb:linkandroid/linkandroid-${{ env.DIST_FILE_NAME }}/
scripts/*:linkandroid/scripts-${{ env.DIST_FILE_NAME }}/
# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# path: |
# dist-release/*.exe
# dist-release/*.dmg
# dist-release/*.AppImage
# dist-release/*.deb