文件
ParlzPackageManger/.github/workflows/release.yml
T

64 行
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: ''
- target: linux-aarch64
cc: aarch64-linux-gnu-gcc
ext: ''
pkg: gcc-aarch64-linux-gnu
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
${{ matrix.cc }} -O2 -Wall -static -std=c11 -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
src/json.c src/ini.c src/mirrors.c src/sha1.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 }}