-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (77 loc) · 2.37 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (77 loc) · 2.37 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
name: Release
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
id-token: write
concurrency: release-${{ github.ref }}
jobs:
preflight:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/setup@v2
with:
install: false
- uses: actions/setup-node@v7
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm run check
- run: pnpm run test
env: { PG_SKIP: "1" }
release:
needs: preflight
runs-on: ubuntu-latest
environment: release
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: nestm_crud
POSTGRES_USER: nestm
POSTGRES_PASSWORD: nestm
POSTGRES_HOST_AUTH_METHOD: trust
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U nestm -d nestm_crud"
--health-interval 2s
--health-timeout 3s
--health-retries 30
--health-start-period 5s
steps:
- uses: actions/checkout@v7
with: { fetch-depth: 0 }
- uses: pnpm/setup@v2
with:
install: false
- uses: actions/setup-node@v7
with: { node-version: 24, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm run verify
env:
PG_URL: postgres://nestm:nestm@localhost:5432/nestm_crud
- name: Create release PR or publish
uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
publish-script: pnpm run release
version-script: pnpm run release:version
pr-title: "chore: release @nestm/crud"
commit-message: "chore: release @nestm/crud"
create-github-releases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Reconcile package tags
if: always()
run: |
for MANIFEST in packages/*/package.json; do
NAME=$(node -p "require('./$MANIFEST').name")
VERSION=$(node -p "require('./$MANIFEST').version")
TAG="$NAME@$VERSION"
if npm view "$NAME@$VERSION" version > /dev/null 2>&1; then
git tag "$TAG" 2> /dev/null && git push origin "$TAG" || true
fi
done