mirror of https://github.com/nirenjan/libx52.git
62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: Create Release
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Upload Release Asset
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install dependencies
|
|
run: ./.github/scripts/install-dependencies-ubuntu.sh
|
|
|
|
- name: Build project
|
|
run: ./.github/scripts/build-and-test.sh
|
|
|
|
- name: Prepare release assets
|
|
run: |
|
|
# Find the Meson generated tarball
|
|
# meson dist usuall creates a tar.xz, but be prepared to handle
|
|
# additional compression formats
|
|
DIST_FILE=$(find build/meson-dist -name 'libx52-*.tar.*' -a ! -name '*.tar.*sum')
|
|
|
|
# Extract the version from the filename
|
|
VERSION=$(echo "$DIST_FILE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
|
|
EXTENSION="${DIST_FILE#*${VERSION}}"
|
|
|
|
ASSET_NAME="libx52_${VERSION}.orig${EXTENSION}"
|
|
ASSET_PATH="build/meson-dist/${ASSET_NAME}"
|
|
|
|
# Rename the file
|
|
mv -v "$DIST_FILE" "$ASSET_PATH"
|
|
|
|
cd build/meson-dist
|
|
rm *.sha256sum
|
|
sha256sum "$ASSET_NAME" > "${ASSET_NAME}.sha256sum"
|
|
cd ../..
|
|
|
|
- name: Generate changelog
|
|
run: ./.github/scripts/generate_changelog.py > ${{ github.workspace }}/CHANGELOG.txt
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
name: Release ${{ github.ref_name }}
|
|
body_path: ${{ github.workspace }}/CHANGELOG.txt
|
|
draft: false
|
|
prerelease: false
|
|
files: |
|
|
build/meson-dist/*
|