-
Notifications
You must be signed in to change notification settings - Fork 58
71 lines (62 loc) · 2.26 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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)
if (( MINOR >= 10 )); then
MAJOR=$((MAJOR + 1))
MINOR=0
else
MINOR=$((MINOR + 1))
fi
echo "$MAJOR.$MINOR" > version
echo "version=$MAJOR.$MINOR" >> $GITHUB_ENV
- name: Build theme
run: |
meson setup -Dprefix="/home/runner/work/${{ github.repository }}/build" build
ninja -C build install
cd /home/runner/work/lassekongo83/adw-gtk3/build/share/themes
tar -cJf adw-gtk3.tar.xz adw-gtk3 adw-gtk3-dark
mv /home/runner/work/lassekongo83/adw-gtk3/build/share/themes/adw-gtk3.tar.xz /home/runner/work/lassekongo83/adw-gtk3/build/share/themes/adw-gtk3v${{ env.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@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.version }}
name: adw-gtk3 v${{ env.version }}
body: >
Full Changelog: https://github.com/lassekongo83/adw-gtk3/compare/${{ env.prev_version }}...v${{ env.version }}
draft: false
prerelease: false
files: |
/home/runner/work/lassekongo83/adw-gtk3/build/share/themes/adw-gtk3v${{ env.version }}.tar.xz
- name: Commit and push
run: |
git config user.name "GitHub-Actions"
git config user.email "<>"
git add version
git commit -m "Bump version to ${{ env.version }}"
git push