112 lines
3.3 KiB
YAML
112 lines
3.3 KiB
YAML
name: Build packages
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_tag:
|
|
description: Release tag to build and publish
|
|
required: true
|
|
type: string
|
|
release_notes:
|
|
description: Optional release notes/comment
|
|
required: false
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
preparation:
|
|
name: Setup build version
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
commitish: ${{ steps.version.outputs.commitish }}
|
|
steps:
|
|
- uses: actions/checkout@v5.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
- id: version
|
|
shell: bash
|
|
run: |
|
|
INPUT_VERSION="${{ inputs.release_tag || '' }}"
|
|
if [ -n "$INPUT_VERSION" ]; then
|
|
VERSION="$INPUT_VERSION"
|
|
else
|
|
VERSION=$(git describe --tags --exact-match 2>/dev/null || true)
|
|
fi
|
|
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
echo "Release version must use x.y.z format, got: ${VERSION:-<empty>}" >&2
|
|
exit 1
|
|
fi
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
echo "commitish=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
|
|
|
build:
|
|
name: Build Tachyon release packages
|
|
runs-on: ubuntu-latest
|
|
needs: preparation
|
|
steps:
|
|
- uses: actions/checkout@v5.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Build release artifacts
|
|
shell: bash
|
|
run: |
|
|
VERSION="${{ needs.preparation.outputs.version }}"
|
|
bash ./build.sh "$VERSION" "$PWD/filtered-bin/release"
|
|
ls -la "$PWD/filtered-bin/release"
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: release-files-${{ needs.preparation.outputs.version }}
|
|
path: ./filtered-bin/release/*
|
|
retention-days: 1
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- preparation
|
|
- build
|
|
steps:
|
|
- uses: actions/checkout@v5.0.0
|
|
- name: Create release dir
|
|
run: mkdir -p ./filtered-bin/release
|
|
|
|
- name: Download release artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release-files-${{ needs.preparation.outputs.version }}
|
|
path: ./filtered-bin/release
|
|
|
|
- name: Release
|
|
if: ${{ inputs.release_notes == '' }}
|
|
uses: softprops/action-gh-release@v2.4.0
|
|
with:
|
|
files: ./filtered-bin/release/*.*
|
|
draft: false
|
|
prerelease: false
|
|
make_latest: true
|
|
name: ${{ needs.preparation.outputs.version }}
|
|
tag_name: ${{ needs.preparation.outputs.version }}
|
|
target_commitish: ${{ needs.preparation.outputs.commitish }}
|
|
|
|
- name: Release with notes
|
|
if: ${{ inputs.release_notes != '' }}
|
|
uses: softprops/action-gh-release@v2.4.0
|
|
with:
|
|
files: ./filtered-bin/release/*.*
|
|
draft: false
|
|
prerelease: false
|
|
make_latest: true
|
|
name: ${{ needs.preparation.outputs.version }}
|
|
tag_name: ${{ needs.preparation.outputs.version }}
|
|
target_commitish: ${{ needs.preparation.outputs.commitish }}
|
|
body: ${{ inputs.release_notes }}
|