Create release #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update && sudo apt-get -y install ninja-build sassc | |
sudo pip3 install meson | |
- name: Update version | |
id: update_version | |
run: | | |
VERSION=$(cat version) | |
MAJOR=$(echo $VERSION | cut -d'.' -f1) | |
MINOR=$(echo $VERSION | cut -d'.' -f2) | |
FORK_VERSION=$(cat fork-version) | |
FMAJOR=$(echo $FORK_VERSION | cut -d'.' -f1) | |
FMINOR=$(echo $FORK_VERSION | cut -d'.' -f2) | |
FMINOR=$((FMINOR + 1)) | |
echo "$FMAJOR.$FMINOR" > fork-version | |
echo "version=$MAJOR.$MINOR" >> $GITHUB_ENV | |
echo "fork-version=$FMAJOR.$FMINOR" >> $GITHUB_ENV | |
- name: Build theme | |
run: | | |
meson setup -Dprefix="/home/runner/work/${{ github.repository }}/build" build | |
ninja -C build install | |
cd /home/runner/work/${{ github.repository }}/build/share/themes | |
tar -cJf adw-gtk3-fork.tar.xz adw-gtk3-fork adw-gtk3-fork-dark | |
mv /home/runner/work/${{ github.repository }}/build/share/themes/adw-gtk3-fork.tar.xz /home/runner/work/${{ github.repository }}/build/share/themes/adw-gtk3-white-headersv${{ env.fork-version }}.tar.xz | |
- name: Get previous release version | |
id: prev_release | |
run: | | |
PREV_VERSION=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
https://api.github.com/repos/${{ github.repository }}/releases/latest \ | |
| jq -r '.tag_name') | |
echo "prev_version=$PREV_VERSION" >> $GITHUB_ENV | |
- name: Create and Upload Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.fork-version }} | |
name: adw-gtk3-white-headers v${{ env.fork-version }} | |
body: > | |
Based on adw-gtk3 v${{ env.version }} | |
draft: false | |
prerelease: false | |
files: | | |
/home/runner/work/${{ github.repository }}/build/share/themes/adw-gtk3-white-headersv${{ env.fork-version }}.tar.xz | |
- name: Commit and push | |
run: | | |
git config user.name "GitHub-Actions" | |
git config user.email "<>" | |
git add fork-version | |
git commit -m "Bump version to ${{ env.fork-version }}" | |
git push |