Skip to content

1.5.13

1.5.13 #55

Workflow file for this run

name: Build
permissions: write-all
on:
workflow_dispatch:
inputs:
version:
description: "Tag version to release"
required: false
push:
branches:
- master
tags:
- v*
paths-ignore:
- 'README.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/issues.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
arch: [x64, arm64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
run: npm install -g pnpm
- name: Install Dependencies and Prepare
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_target_arch: ${{ matrix.arch }}
run: |
pnpm install
pnpm add @mihomo-party/sysproxy-${{ matrix.os == 'windows-latest' && 'win32' || matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}-${{ matrix.arch }}${{ matrix.os == 'ubuntu-latest' && '-gnu' || matrix.os == 'windows-latest' && '-msvc' || '' }}
pnpm prepare --${{ matrix.arch }}
- name: Build
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_target_arch: ${{ matrix.arch }}
run: |
chmod +x build/pkg-scripts/postinstall
pnpm build:${{ matrix.os == 'windows-latest' && 'win' || matrix.os == 'ubuntu-latest' && 'linux' || 'mac' }} --${{ matrix.arch }}
- name: Generate latest.yml
run: pnpm updater
- run: ls dist
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: |
dist/*
latest.yml
changelog.md
pre-release:
if: startsWith(github.ref, 'refs/heads/') || ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version == '' }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: bin/
merge-multiple: true
- run: ls bin
- name: Delete current release assets
uses: 8Mi-Tech/delete-release-assets-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: Prerelease-${{ github.ref_name }}
deleteOnlyFromDrafts: false
- name: Publish Prerelease
if: success()
uses: softprops/action-gh-release@v2
with:
tag_name: pre-release
files: |
bin/*
prerelease: true
release:
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.version != '')
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: bin/
merge-multiple: true
- run: mv bin/changelog.md ./
- name: Publish Release
if: success()
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.version != '' && github.event.inputs.version || github.ref }}
body_path: changelog.md
files: |
bin/*