-
Notifications
You must be signed in to change notification settings - Fork 210
91 lines (78 loc) · 2.84 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (78 loc) · 2.84 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
---
name: release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
env:
PKG_CACHE_PATH: .pkg
jobs:
release:
runs-on: ubuntu-24.04
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
- name: Set version from tag
if: github.ref_type == 'tag'
run: |
sed -i "s/0.0.0/${GITHUB_REF_NAME}/g" package.json src/index.ts
- uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v5.0.3
with:
path: ${{ env.PKG_CACHE_PATH }}
key: pkg-cache
- run: npm ci
- run: npm run build
- run: npm run esbuild
- run: npm run pkg-all
- name: Install rclone
run: sudo apt-get update && sudo apt-get install -y rclone
- name: Download existing ppa from R2
continue-on-error: true
run: rclone copy r2:${R2_BUCKET}/ ppa/
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
RCLONE_CONFIG_R2_NO_CHECK_BUCKET: true
- name: Import GPG key and preset passphrase
run: |
echo "${GPG_PRIVATE_KEY}" | gpg --batch --import
echo "allow-preset-passphrase" >> ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent
gpgconf --launch gpg-agent
for keygrip in $(gpg --list-secret-keys --with-keygrip --with-colons madsjon@gmail.com | awk -F: '/grp/{print $10}'); do
/usr/lib/gnupg/gpg-preset-passphrase --preset --passphrase "${GPG_PASSPHRASE}" "$keygrip"
done
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Build .deb and sign
run: ./publish-deb
- name: Publish to npm
if: github.ref_type == 'tag'
run: npm publish --provenance
- name: Create GitHub Release
if: github.ref_type == 'tag'
run: gh release create "${GITHUB_REF_NAME}" bin/*.gz --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ppa to Cloudflare R2
if: github.ref_type == 'tag'
run: rclone copy ppa/ r2:${R2_BUCKET}/
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
RCLONE_CONFIG_R2_NO_CHECK_BUCKET: true