Files
XC_VM/.github/workflows/build-release.yml
T

82 lines
2.3 KiB
YAML

name: Build Release Assets
on:
release:
types: [released]
workflow_dispatch:
inputs:
tag_name:
description: 'Release tag (e.g., 1.2.3)'
required: true
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.tag.outputs.name }}
release_name: ${{ github.event.release.name || steps.tag.outputs.name }}
steps:
- name: Resolve tag name
id: tag
run: |
TAG="${{ github.event.inputs.tag_name || github.event.release.tag_name }}"
echo "name=${TAG}" >> "$GITHUB_OUTPUT"
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ steps.tag.outputs.name }}
fetch-depth: 0
filter: blob:none
- name: Determine previous tag
id: prev_tag
run: |
CURRENT_TAG="${{ steps.tag.outputs.name }}"
PREV_TAG=$(git tag --sort=-v:refname | awk -v cur="$CURRENT_TAG" 'found { print; exit } $0 == cur { found=1 }')
if [ -z "$PREV_TAG" ]; then
echo "No previous tag found — update archives will be skipped"
echo "found=false" >> "$GITHUB_OUTPUT"
else
echo "Previous tag: ${PREV_TAG}"
echo "tag=${PREV_TAG}" >> "$GITHUB_OUTPUT"
echo "found=true" >> "$GITHUB_OUTPUT"
fi
- name: Clean dist directory
run: make new
- name: Build LB install archive
run: make lb
- name: Build MAIN install archive
run: make main
- name: Build MAIN update archive
if: steps.prev_tag.outputs.found == 'true'
run: make main_update LAST_TAG="${{ steps.prev_tag.outputs.tag }}"
- name: Build LB update archive
if: steps.prev_tag.outputs.found == 'true'
run: make lb_update LAST_TAG="${{ steps.prev_tag.outputs.tag }}"
- name: Upload assets to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.name }}
files: dist/*
notify:
needs: build
uses: ./.github/workflows/release-notifier.yml
with:
tag_name: ${{ needs.build.outputs.tag_name }}
release_name: ${{ needs.build.outputs.release_name }}
is_prerelease: false
secrets: inherit