镜像自地址
https://github.com/JGZYES/ParlzPackageManger.git
已同步 2026-09-11 08:52:45 +08:00
60 行
1.5 KiB
YAML
60 行
1.5 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- target: windows-amd64
|
|
cc: x86_64-w64-mingw32-gcc
|
|
ext: .exe
|
|
pkg: mingw-w64
|
|
- target: linux-amd64
|
|
cc: gcc
|
|
ext: ''
|
|
pkg: ''
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install toolchain
|
|
if: ${{ matrix.pkg != '' }}
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ${{ matrix.pkg }}
|
|
|
|
- name: Build pmm
|
|
run: |
|
|
mkdir -p out
|
|
VER=${{ github.ref_type == 'tag' && github.ref_name || 'dev' }}
|
|
VER=${VER#v}
|
|
${{ matrix.cc }} -O2 -Wall -static -std=c11 -DPMM_VERSION=\"$VER\" -o out/pmm${{ matrix.ext }} \
|
|
src/main.c src/json.c src/ini.c src/pmm.c src/http.c src/repo.c src/install.c \
|
|
src/sha256.c src/sha1.c src/mirrors.c src/pdm.c
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.target }}
|
|
path: out/*
|
|
if-no-files-found: error
|
|
|
|
- name: Release (tagged)
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
out/pmm${{ matrix.ext }}
|
|
generate_release_notes: true
|
|
name: PMM ${{ github.ref_name }}
|