-
-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (118 loc) · 4.02 KB
/
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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release PostPilot
on:
release:
types: [published]
permissions:
contents: write
id-token: write
jobs:
release-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.8.0'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
- name: Install Syft
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Install Cosign
uses: sigstore/[email protected]
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean --config .goreleaser.amd64.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_EXPERIMENTAL: 1
release-arm64:
runs-on: buildjet-4vcpu-ubuntu-2204-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.8.0'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
- name: Install Syft
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Install Cosign
uses: sigstore/[email protected]
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean --config .goreleaser.arm64.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_EXPERIMENTAL: 1
publish-aur:
needs: [release-amd64, release-arm64]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate PKGBUILD
run: |
# Remove 'v' prefix from version number for pkgver
VERSION="${{ github.ref_name }}"
VERSION_NO_V="${VERSION#v}"
echo "Building package for version: $VERSION_NO_V"
cat > PKGBUILD << EOF
# Maintainer: Watzon <[email protected]>
pkgname=postpilot-bin
pkgver=${VERSION_NO_V}
pkgrel=1
pkgdesc="Email and SMTP testing GUI for developers"
arch=('x86_64' 'aarch64')
url="https://github.com/watzon/postpilot"
license=('MIT')
depends=('gtk3' 'webkit2gtk')
provides=('postpilot')
conflicts=('postpilot')
source_x86_64=("\${pkgname}-\${pkgver}-x86_64.pkg.tar.zst::https://github.com/watzon/postpilot/releases/download/${VERSION}/postpilot_\${pkgver}_linux_amd64.pkg.tar.zst")
source_aarch64=("\${pkgname}-\${pkgver}-aarch64.pkg.tar.zst::https://github.com/watzon/postpilot/releases/download/${VERSION}/postpilot_\${pkgver}_linux_arm64.pkg.tar.zst")
sha256sums_x86_64=('SKIP')
sha256sums_aarch64=('SKIP')
package() {
cd "\$srcdir"
cp -r usr/ "\$pkgdir/"
}
EOF
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: postpilot-bin
pkgbuild: ./PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to version ${GITHUB_REF#refs/tags/v}"