Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/scripts/increment-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

PROJECT=$1 # ${{ inputs.project }}
INPUT_VERSION=$2 # ${{ inputs.version }}
INCREMENT=$3 # ${{ inputs.increment || 'patch' }}

LATEST_TAG=$(git tag --list --format="%(refname:short)" --sort taggerdate "${PROJECT}*" 2>/dev/null | tail -1)
LATEST_TAG=$(echo "$LATEST_TAG" | awk -F/ '{print $NF}')
VERSION=${LATEST_TAG:-0.0.0}
if [[ -n "${INPUT_VERSION}" ]]; then
# Strip 'v' prefix if present
VERSION=${INPUT_VERSION#v}
else
# Ensure we have a full semver (pad with .0 if needed)
case $(echo "$VERSION" | tr '.' '\n' | wc -l) in
1) VERSION="$VERSION.0.0" ;;
2) VERSION="$VERSION.0" ;;
esac
npm install -g semver 2>&1 >/dev/null
NEW_VERSION=$(semver -i $INCREMENT $VERSION)
VERSION="$NEW_VERSION"
fi
echo "version=$VERSION"
echo "prev_version=${LATEST_TAG}"
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build and Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., v1.0.0) - leave empty to auto-increment"
required: false
type: string
project:
description: "Which project to tag"
required: true
type: choice
options:
- rekkord
- goupile
- tytools
- meestic
#- felix
#- heimdall
increment:
description: "How to increment version if not specified"
required: false
default: "patch"
type: choice
options:
- patch
- minor
- major
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v5
with:
fetch-depth: 0
- name: Determine new version
id: version
run: |
bash .github/scripts/increment-tag.sh \
"${{ inputs.project }}" \
"${{ inputs.version }}" \
"${{ inputs.increment || 'patch' }}" \
| tee $GITHUB_OUTPUT
- name: Building source tarball for ${{ inputs.project }}
run: |
export VERSION="${{ steps.version.outputs.version }}"
tag="${{ inputs.project }}/${{ steps.version.outputs.version }}"

sudo apt-get update
sudo apt-get install build-essential libudev-dev qt6-base-dev qt6-base-dev-tools qt6-svg-dev

bash src/${{ inputs.project }}/dist/source/source.sh

mv bin/Packages/*tar.gz bin/Packages/${{ inputs.project }}-${{ steps.version.outputs.version }}.tar.gz
mv bin/Packages/*tar.xz bin/Packages/${{ inputs.project }}-${{ steps.version.outputs.version }}.tar.xz
- name: Tag and release
run: |
tag="${{ inputs.project }}/${{ steps.version.outputs.version }}"

git tag $tag
git push origin $tag

gh release create $tag \
--title "Release $tag" \
--notes "Release $tag" \
--latest \
bin/Packages/*tar*
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3 changes: 2 additions & 1 deletion tools/package/build/source/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ directories=$(grep -E -o '[|"](lib/native|lib/web|src|vendor)/[a-zA-Z0-9_\-]+/'
sources="bootstrap.sh bootstrap.bat FelixBuild.ini.presets ${directories}"
imports=$(ls "${DEST_DIR}/bin/Log/"*.json | grep -v compile_commands | xargs jq -r '.imports | .[]')

VERSION=$(./felix -pDebug -O "${DEST_DIR}/bin" --run "${VERSION_TARGET}" --version | awk -F'[ ]' "/^${VERSION_TARGET}/ {print \$2}")
LOCAL_VERSION=$(./felix -pDebug -O "${DEST_DIR}/bin" --run "${VERSION_TARGET}" --version | awk -F'[ ]' "/^${VERSION_TARGET}/ {print \$2}")
VERSION=${VERSION:-$LOCAL_VERSION}
TMP_DIR="${DEST_DIR}/${PKG_NAME}_${VERSION}"
DEST_TAR="../../${PKG_NAME}_${VERSION}_src.tar"

Expand Down