ptr89/.github/workflows/ci.yml
Kirill Zhumarin c572ee06e9 Fix CI
2026-10-25 18:45:46 +03:00

79 lines
2.3 KiB
YAML

name: Build
on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: Release tag
required: false
type: string
permissions:
contents: write
id-token: write
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Installing dependencies
run: |
sudo apt-get update
sudo apt-get -y install cmake mingw-w64 mingw-w64-tools mingw-w64-i686-dev mingw-w64-x86-64-dev mingw-w64-common fakeroot build-essential debhelper
- name: Building ptr89
run: |
tools/build_deb.sh
tools/build_win.sh
tools/build_tar.sh
- uses: mymindstorm/setup-emsdk@v14
- uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install --global corepack@latest npm@latest
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile
- run: emcmake cmake -B build-wasm -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS:BOOL=TRUE
- run: pnpm exec cmake --build build-wasm
- run: pnpm run build
- run: pnpm test
- uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: ${{ inputs.release_tag || github.ref_name }}
files: |
../*.deb
build/*.tar.gz
build-win/*.exe
- name: Check out homebrew tap
uses: actions/checkout@v3
with:
repository: siemens-mobile-hacks/homebrew-tap
path: ./tap
token: ${{ secrets.TAP_GITHUB_TOKEN }}
- name: Generate formula
env:
RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }}
run: |
sed -i "s/RELEASE_TAG_NAME/$RELEASE_TAG/g" ptr89.rb
sed -i "s/RELEASE_TAG_HASH/$GITHUB_SHA/g" ptr89.rb
cat ptr89.rb
cd tap
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
cp ../ptr89.rb Formula/ptr89.rb
git add Formula/ptr89.rb
git commit -m "ptr89: $GITHUB_REF_NAME"
git push --set-upstream origin main