-
Notifications
You must be signed in to change notification settings - Fork 2
142 lines (134 loc) · 4.81 KB
/
Copy pathpublish.yml
File metadata and controls
142 lines (134 loc) · 4.81 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
name: Publish
run-name: Publish ${{ github.ref_name }}
on:
push:
tags:
- v*
jobs:
build:
name: Build
uses: ./.github/workflows/_build.yml
release:
name: GitHub Releases
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: ${{ needs.build.outputs.artifact_name }}
path: .
- name: Generate release notes
id: changelog
run: |
mkdir tmp
outfile=tmp/changelog.txt
echo "outfile=${outfile}" >> $GITHUB_OUTPUT
npx standard-changelog@^5.0.0 --release-count 2 --infile $outfile.tmp --outfile $outfile.tmp
sed '1,3d' $outfile.tmp > $outfile
- name: Create GitHub release
uses: softprops/action-gh-release@v3
with:
token: ${{ secrets.GH_TOKEN }}
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref_name, '-') }}
files: |
*.tgz
release/seam-*
release/checksums.txt
body_path: ${{ github.workspace }}/${{ steps.changelog.outputs.outfile }}
npm:
name: npm
uses: ./.github/workflows/_publish.yml
needs: build
permissions:
contents: read
id-token: write
with:
artifact_name: ${{ needs.build.outputs.artifact_name }}
registry_url: https://registry.npmjs.org
github:
name: GitHub Packages
uses: ./.github/workflows/_publish.yml
permissions:
contents: read
packages: write
needs: build
with:
artifact_name: ${{ needs.build.outputs.artifact_name }}
registry_url: https://npm.pkg.github.com
secrets:
registry_token: ${{ secrets.GITHUB_TOKEN }}
aur:
name: AUR
runs-on: ubuntu-latest
timeout-minutes: 30
needs: release
if: ${{ !contains(github.ref_name, '-') }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Generate PKGBUILD
env:
MAINTAINER: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}>
REPOSITORY: ${{ github.repository }}
run: |
set -euo pipefail
pkgname=seam-bin
pkgver="${GITHUB_REF_NAME#v}"
url="https://github.com/${REPOSITORY}"
pkgdesc=$(jq --raw-output '.description' package.json)
mkdir -p aur
# The binaries are single-file Bun executables with the JavaScript
# bundle appended, so they must not be stripped.
#
# The sha256sums placeholders are load bearing: updpkgsums replaces
# them when publishing, and makepkg picks the digest algorithm from
# the arrays already present rather than always defaulting to sha256.
cat > aur/PKGBUILD <<PKGBUILD
# Maintainer: ${MAINTAINER}
# Generated by ${url}/blob/v${pkgver}/.github/workflows/publish.yml
pkgname=${pkgname}
pkgver=${pkgver}
pkgrel=1
pkgdesc="${pkgdesc}"
arch=('x86_64' 'aarch64')
url="${url}"
license=('MIT')
depends=('glibc' 'gcc-libs')
optdepends=('bash-completion: completions for bash')
provides=('seam')
conflicts=('seam')
options=('!strip' '!debug')
source=("\${url}/raw/v\${pkgver}/LICENSE.txt"
"\${url}/releases/download/v\${pkgver}/seam-completions-v\${pkgver}.tar.gz")
source_x86_64=("\${pkgname}-\${pkgver}-x86_64::\${url}/releases/download/v\${pkgver}/seam-v\${pkgver}-linux-x64")
source_aarch64=("\${pkgname}-\${pkgver}-aarch64::\${url}/releases/download/v\${pkgver}/seam-v\${pkgver}-linux-arm64")
sha256sums=('SKIP' 'SKIP')
sha256sums_x86_64=('SKIP')
sha256sums_aarch64=('SKIP')
package() {
install -Dm755 "\${pkgname}-\${pkgver}-\${CARCH}" "\${pkgdir}/usr/bin/seam"
install -Dm644 seam.bash "\${pkgdir}/usr/share/bash-completion/completions/seam"
install -Dm644 seam.fish "\${pkgdir}/usr/share/fish/vendor_completions.d/seam.fish"
install -Dm644 seam.zsh "\${pkgdir}/usr/share/zsh/site-functions/_seam"
install -Dm644 LICENSE.txt "\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE"
}
PKGBUILD
cat aur/PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v4.2.0
with:
pkgname: seam-bin
pkgbuild: aur/PKGBUILD
commit_username: ${{ secrets.GIT_USER_NAME }}
commit_email: ${{ secrets.GIT_USER_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update to ${{ github.ref_name }}
updpkgsums: true