Skip to content

Publish release

Publish release #1

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Publish release
on:
workflow_dispatch:
workflow_call:
inputs:
target:
description: "The git ref to checkout, build from and release"
required: true
type: string
tag:
description: "The tag of the release"
required: true
type: string
prerelease:
description: "Prerelease"
required: false
default: false
type: boolean
env:
CI_DIR: 2049ef39-42a2-46d2-b513-ee6d2e3a7b15
jobs:
build:
uses: ./.github/workflows/build.yml
with:
target: ${{ inputs.target }}
publish-release:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download build artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: build
path: ${{ env.CI_DIR }}
- name: Extract build artifacts
run: |
artifacts_dir="$(realpath -m "$CI_DIR/artifacts")"
mkdir -p "$artifacts_dir"
tar -xzf "$CI_DIR/build.tar.gz" -C "$artifacts_dir"
rm "$CI_DIR/build.tar.gz"
- name: Copy Binaries
run: |
artifacts_dir="$(realpath -m "$CI_DIR/artifacts")"
cp "${artifacts_dir}/bin/win-x64/Luatrauma.AutoUpdater.exe" "${artifacts_dir}/Luatrauma.AutoUpdater.win-x64.exe"
cp "${artifacts_dir}/bin/linux-x64/Luatrauma.AutoUpdater.exe" "${artifacts_dir}/Luatrauma.AutoUpdater.linux-x64"
cp "${artifacts_dir}/bin/osx-x64/Luatrauma.AutoUpdater.exe" "${artifacts_dir}/Luatrauma.AutoUpdater.osx-x64"
- name: Publish release
uses: notpeelz/action-gh-create-release@c1bebd17c8a128e8db4165a68be4dc4e3f106ff1 # v5.0.1
with:
target: ${{ inputs.target }}
tag: ${{ inputs.tag }}
prerelease: ${{ inputs.prerelease }}
strategy: replace
title: "Automatic build"
body: "Automatic build"
files: |
${artifacts_dir}/Luatrauma.AutoUpdater.win-x64.exe
${artifacts_dir}/Luatrauma.AutoUpdater.linux-x64
${artifacts_dir}/Luatrauma.AutoUpdater.osx-x64