Repository navigation
57 lines (53 loc) · 1.99 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (53 loc) · 1.99 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
name: Release Zotero exporter
on:
push:
tags:
- zotero-exporter-v*
permissions:
contents: read
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
name: Package and publish ${{ github.ref_name }}
needs: ci
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
env:
MDBASE_ENV: production
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Resolve exporter version
id: version
run: |
version="${TAG#zotero-exporter-v}"
test "$version" = "$(jq -r .version apps/zotero-exporter/package.json)"
prerelease=false
case "$version" in *-*) prerelease=true ;; esac
printf 'version=%s\nprerelease=%s\n' "$version" "$prerelease" >> "$GITHUB_OUTPUT"
- run: pnpm --filter @mdbase-reader/zotero-exporter build
- name: Verify tree is clean
run: test -z "$(git status --porcelain)"
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ steps.version.outputs.version }}
PRERELEASE: ${{ steps.version.outputs.prerelease }}
run: |
mkdir -p "$RUNNER_TEMP/release"
cp apps/zotero-exporter/dist/*.xpi "$RUNNER_TEMP/release/"
cd "$RUNNER_TEMP/release"
sha256sum -- *.xpi > SHA256SUMS
printf 'Built from `%s` by run %s for production.\n' "$GITHUB_SHA" "$GITHUB_RUN_ID" > notes.md
flags=()
if [ "$PRERELEASE" = true ]; then flags+=(--prerelease); fi
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --verify-tag --title "Zotero exporter $VERSION" --notes-file notes.md "${flags[@]}" -- *.xpi SHA256SUMS