Files
xemu/.github/workflows/build.yml
T
dependabot[bot] 5dbe77aec3 ci: bump actions/upload-artifact from 7.0.1 to 7.0.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-12 12:37:18 -07:00

84 lines
2.4 KiB
YAML

name: Build
on:
workflow_call:
inputs:
ref:
description: Git ref (commit, branch, or tag) to build
required: true
type: string
outputs:
pkg_version:
description: Build version
value: ${{ jobs.source.outputs.pkg_version }}
jobs:
source:
name: Create source package
runs-on: ubuntu-latest
outputs:
pkg_version: ${{ steps.version.outputs.pkg_version }}
steps:
- name: Clone tree
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Install dependencies
run: sudo apt-get install meson
- name: Determine release version
id: version
run: |
if TAG=$(git describe --tags --match 'v*' 2>/dev/null); then
echo "pkg_version=${TAG#v}" >> $GITHUB_OUTPUT
else
SHORT_HASH=$(git rev-parse --short HEAD)
echo "pkg_version=0.0.0-0-unofficial-${SHORT_HASH}" >> $GITHUB_OUTPUT
fi
- name: Create source package
id: package
run: |
pkg_name="xemu-${{ steps.version.outputs.pkg_version }}"
tar_filename="${pkg_name}.tar"
tar_prefix="./${pkg_name}/"
./scripts/archive-source.sh ${tar_filename} ${tar_prefix}
echo -n ${{ github.sha }} > XEMU_COMMIT
echo -n ${{ steps.version.outputs.pkg_version }} > XEMU_VERSION
tar -r --file "${tar_filename}" --transform "s,^./,${tar_prefix}," ./XEMU_COMMIT ./XEMU_VERSION
zstd "${tar_filename}"
echo "pkg_filename=${tar_filename}.zst" >> $GITHUB_OUTPUT
- name: Upload source package artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v4
with:
name: src
path: ${{ steps.package.outputs.pkg_filename }}
compression-level: 0
linux:
name: Linux
needs: source
uses: ./.github/workflows/build-linux.yml
with:
pkg_version: ${{ needs.source.outputs.pkg_version }}
macos:
name: macOS
needs: source
uses: ./.github/workflows/build-macos.yml
with:
pkg_version: ${{ needs.source.outputs.pkg_version }}
windows:
name: Windows
needs: source
uses: ./.github/workflows/build-windows.yml
with:
pkg_version: ${{ needs.source.outputs.pkg_version }}
test:
name: Unit tests
needs: source
uses: ./.github/workflows/build-tests.yml