Files
2026-03-13 16:16:06 +01:00

83 lines
2.2 KiB
YAML

name: Build
on:
workflow_call:
inputs:
version-suffix:
required: true
type: string
archive-suffix:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target-runtime: [linux-x64, win-x64]
configuration: [Debug, Release]
name: Z64Utils-${{ matrix.target-runtime }}-${{ matrix.configuration }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
restore_args: --runtime ${{ matrix.target-runtime }}
build_args: --no-self-contained --configuration ${{ matrix.configuration }} --version-suffix '${{ inputs.version-suffix }}' --property:IncludeSourceRevisionInInformationalVersion=false
archive_name: Z64Utils-${{ matrix.target-runtime }}-${{ matrix.configuration }}-${{ inputs.archive-suffix }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: dotnet info
shell: bash
run: |
dotnet --info
- name: dotnet restore
shell: bash
run: |
dotnet restore Z64Utils/Z64Utils.csproj ${{ env.restore_args }}
- name: dotnet build
shell: bash
run: |
dotnet build Z64Utils/Z64Utils.csproj ${{ env.restore_args }} ${{ env.build_args }}
- name: dotnet publish
shell: bash
run: |
dotnet publish Z64Utils/Z64Utils.csproj --output publish_out/ ${{ env.restore_args }} ${{ env.build_args }}
- uses: actions/checkout@v6
with:
repository: zeldaret/Z64Utils
ref: config
path: Z64Utils-Config
fetch-depth: 0
- name: Copy versions data
shell: bash
run: |
cp -r -t publish_out/ Z64Utils-Config/versions
- name: Create .tar.gz archive
shell: bash
run: |
cd publish_out
tar -czvf ../${{ env.archive_name }}.tar.gz *
- name: Create .zip archive
shell: bash
run: |
cd publish_out
zip -r ../${{ env.archive_name }}.zip *
- name: Upload archive
uses: actions/upload-artifact@v6
with:
name: ${{ env.archive_name }}
path: |
${{ env.archive_name }}.tar.gz
${{ env.archive_name }}.zip