Skip to content

fix: update fetch_dependencies script for GitHub Actions #6

fix: update fetch_dependencies script for GitHub Actions

fix: update fetch_dependencies script for GitHub Actions #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*' # Triggers on version tags like v1.0.0, v1.2.3, etc.
permissions:
contents: write
packages: write
pull-requests: read
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "Building TinyRequest version: $VERSION"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
libglfw3-dev \
libcurl4-openssl-dev \
libcjson-dev \
libgl1-mesa-dev \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
pkg-config
- name: Fetch external dependencies
run: |
chmod +x scripts/fetch_dependencies.sh
./scripts/fetch_dependencies.sh
- name: Update version in debian control
run: |
sed -i "s/Version: .*/Version: ${{ steps.get_version.outputs.VERSION }}/" debian/DEBIAN/control
echo "Updated version to ${{ steps.get_version.outputs.VERSION }}"
- name: Build and package
run: |
chmod +x scripts/build_and_package.sh
./scripts/build_and_package.sh
- name: Create checksums
run: |
sha256sum "tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb" > "tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb.sha256"
echo "Package created: tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb"
echo "Size: $(du -h tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb | cut -f1)"
echo "SHA256: $(cat tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb.sha256 | cut -d' ' -f1)"
- name: Create Release with GitHub CLI
run: |
# Create release notes
cat > release_notes.md << EOF
# TinyRequest ${{ steps.get_version.outputs.TAG }}
## Installation
\`\`\`bash
wget https://github.com/dexter-xD/TinyRequest/releases/download/${{ steps.get_version.outputs.TAG }}/tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb
sudo dpkg -i tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb
sudo apt-get install -f # Fix any dependency issues
\`\`\`
## Run
\`\`\`bash
tinyrequest
\`\`\`
## Package Info
- **Version**: ${{ steps.get_version.outputs.VERSION }}
- **Architecture**: amd64
- **Size**: $(du -h tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb | cut -f1)
- **SHA256**: $(cat tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb.sha256 | cut -d' ' -f1)
EOF
# Create the release
gh release create ${{ steps.get_version.outputs.TAG }} \
--title "TinyRequest ${{ steps.get_version.outputs.TAG }}" \
--notes-file release_notes.md \
tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb \
tinyrequest-v${{ steps.get_version.outputs.VERSION }}.deb.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}