-
Notifications
You must be signed in to change notification settings - Fork 6
81 lines (69 loc) · 2.52 KB
/
Copy pathrelease.yml
File metadata and controls
81 lines (69 loc) · 2.52 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
name: Analyze & Release
on:
push:
branches:
- main
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
run_install: false
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Pin commit metadata into .git-info
# prebuild writes .git-info via `git rev-parse` from the CI checkout.
# Overwrite with explicit github-context values so the file is correct
# even if a future prebuild change starts skipping the write.
run: |
jq -n \
--arg branch "${{ github.ref_name }}" \
--arg hash "${GITHUB_SHA:0:7}" \
--arg title "$(git log -1 --format=%s)" \
--arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
'{branch:$branch, commitHash:$hash, commitTitle:$title, buildDate:$date}' \
> .git-info
- name: Set install script default branch
run: sed -i 's/__BRANCH__/${{ github.ref_name }}/' scripts/install
- name: Create deploy tarball
run: |
tar czf /tmp/sleepypod-core.tar.gz \
--exclude='node_modules' \
--exclude='.git' \
--exclude='.env*' \
--exclude='*.db' \
--exclude='*.db-*' \
--exclude='test-results' \
--exclude='.serena' \
--exclude='.claude' \
.
mv /tmp/sleepypod-core.tar.gz .
- name: Refresh tags (force, prune)
# semantic-release runs `git fetch --tags` unconditionally and aborts
# on any "would clobber existing tag" conflict. Force-prune up front so
# a stale or colliding tag can't block the release.
run: git fetch --tags --force --prune --prune-tags origin
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm dlx semantic-release