Skip to content

PKGBUILD: Bump version to 2.2 and reset pkgrel to 1 #1

PKGBUILD: Bump version to 2.2 and reset pkgrel to 1

PKGBUILD: Bump version to 2.2 and reset pkgrel to 1 #1

Workflow file for this run

name: Release
on:
push:
branches: [master]
paths:
- PKGBUILD
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Install dependencies
run: pacman -Syu --noconfirm git git-cliff github-cli
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Work around git safe directory in container
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Extract version from PKGBUILD
id: version
run: |
pkgver=$(grep '^pkgver=' PKGBUILD | cut -d= -f2)
pkgrel=$(grep '^pkgrel=' PKGBUILD | cut -d= -f2)
tag="v${pkgver}-${pkgrel}"
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "version=${pkgver}-${pkgrel}" >> "$GITHUB_OUTPUT"
- name: Check if tag already exists
id: check_tag
run: |
if git rev-parse "refs/tags/${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate changelog for this release
if: steps.check_tag.outputs.exists == 'false'
id: changelog
run: |
changelog=$(git-cliff --config cliff.toml --unreleased --strip header --tag "${{ steps.version.outputs.tag }}")
{
echo "content<<CHANGELOG_EOF"
echo "$changelog"
echo "CHANGELOG_EOF"
} >> "$GITHUB_OUTPUT"
- name: Create tag and release
if: steps.check_tag.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag "${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"
gh release create "${{ steps.version.outputs.tag }}" \
--title "${{ steps.version.outputs.tag }}" \
--notes "${{ steps.changelog.outputs.content }}"