-
Notifications
You must be signed in to change notification settings - Fork 8
126 lines (122 loc) · 4.45 KB
/
Copy pathbuild.yml
File metadata and controls
126 lines (122 loc) · 4.45 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Build waytrogen
on:
push:
tags:
- "*.*.*"
jobs:
build-prefix-usr-binary:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v4
- name: Get dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-4-1 openssl libsqlite3-0 libsqlite3-dev libglib2.0-dev sqlite3 libgtk-4-dev meson ninja-build cargo gettext desktop-file-utils
version: cargo-deps-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Rust Artifacts
uses: Swatinem/rust-cache@v2
with:
cache-directories: "./target"
- name: Build waytrogen
run: cargo build --release
- name: Upload ccompiled binary
uses: actions/upload-artifact@v4
id: compiled-meson-project
with:
name: waytrogen_${{ github.ref_name }}_amd64
path: ./target/release/waytrogen
package-deb-file:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v4
- name: Get dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-4-1 openssl libsqlite3-0 libsqlite3-dev libglib2.0-dev sqlite3 libgtk-4-dev meson ninja-build cargo gettext desktop-file-utils
version: cargo-deps-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Rust Artifacts
uses: Swatinem/rust-cache@v2
with:
cache-directories: "builddir/target"
- name: Build waytrogen
run: |
TAG=${{ github.ref_name }}
PACKAGE_NAME="waytrogen_${TAG}_amd64"
PREFIX="debpkgs/${PACKAGE_NAME}"
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV
sed -i "s/VERSION/${TAG}/" meson.build
meson setup builddir --prefix="$(realpath $PREFIX)"
meson compile -C builddir
meson install -C builddir
mkdir -p "$PREFIX/DEBIAN"
mv debpkgs/control debpkgs/postinst "$PREFIX/DEBIAN"
sed -i "s/VERSION/${TAG}/" "$PREFIX/DEBIAN/control"
chmod 755 "$PREFIX/DEBIAN/postinst"
dpkg-deb --build "$PREFIX"
- name: Upload deb package
uses: actions/upload-artifact@v4
with:
name: "${{ env.PACKAGE_NAME }}.deb"
path: debpkgs/*.deb
create-release:
needs: [ build-prefix-usr-binary, package-deb-file ]
runs-on: ubuntu-latest
steps:
- name: Get generic build prefix usr binary
uses: actions/download-artifact@v4
with:
name: waytrogen_${{ github.ref_name }}_amd64
- name: Rename precompiled binary
run: mv waytrogen waytrogen_${{ github.ref_name }}_amd64
- name: Get deb file
uses: actions/download-artifact@v4
with:
name: waytrogen_${{ github.ref_name }}_amd64.deb
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
waytrogen_${{ github.ref_name }}_amd64
waytrogen_${{ github.ref_name }}_amd64.deb
make_latest: 'true'
publish-waytrogen-to-aur:
runs-on: ubuntu-latest
steps:
- name: Get AUR PKGBUILD
run: |
git clone https://aur.archlinux.org/waytrogen.git
- name: Prepare PKGBUILD
run:
sed -i "s/pkgver=.*/pkgver=${{ github.ref_name }}/" waytrogen/PKGBUILD
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
with:
pkgname: waytrogen
pkgbuild: ./waytrogen/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update to ${{ github.ref_name }}
publish-waytrogen-bin-to-aur:
permissions:
contents: write
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Get AUR PKGBUILD
run: |
git clone https://aur.archlinux.org/waytrogen-bin.git
- name: Prepare PKGBUILD
run:
sed -i "s/pkgver=.*/pkgver=${{ github.ref_name }}/" waytrogen-bin/PKGBUILD
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
with:
pkgname: waytrogen-bin
pkgbuild: ./waytrogen-bin/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update to ${{ github.ref_name }}