-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (107 loc) · 3.66 KB
/
Copy pathrelease.yml
File metadata and controls
113 lines (107 loc) · 3.66 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
name: Release
on:
push:
branches: [release]
concurrency:
group: bumpy-release-${{ github.ref }}
cancel-in-progress: false
jobs:
plan:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
mode: ${{ steps.plan.outputs.mode }}
bumpy_version: ${{ steps.bumpy-version.outputs.version }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
- id: bumpy-version
run: |
VERSION=$(jq -r '.devDependencies["@varlock/bumpy"] // .dependencies["@varlock/bumpy"]' package.json | sed 's/[\^~]//')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "BUMPY_VERSION=$VERSION" >> "$GITHUB_ENV"
- id: plan
run: pnpm dlx "@varlock/bumpy@$BUMPY_VERSION" ci plan
env:
GH_TOKEN: ${{ github.token }}
version-pr:
needs: plan
if: needs.plan.outputs.mode == 'version-pr'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
BUMPY_VERSION: ${{ needs.plan.outputs.bumpy_version }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: pnpm
- run: test -n "$BUMPY_GH_TOKEN"
env:
BUMPY_GH_TOKEN: ${{ secrets.BUMPY_GH_TOKEN }}
- run: pnpm dlx "@varlock/bumpy@$BUMPY_VERSION" ci release --expect-mode version-pr
env:
GH_TOKEN: ${{ github.token }}
BUMPY_GH_TOKEN: ${{ secrets.BUMPY_GH_TOKEN }}
publish:
needs: plan
if: needs.plan.outputs.mode == 'publish'
runs-on: ubuntu-latest
environment: publish
timeout-minutes: 15
permissions:
contents: write
id-token: write
env:
BUMPY_VERSION: ${{ needs.plan.outputs.bumpy_version }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
package-manager-cache: false
- run: npm install --global npm@latest
- run: pnpm install --frozen-lockfile
- run: test -n "$BUMPY_GH_TOKEN"
env:
BUMPY_GH_TOKEN: ${{ secrets.BUMPY_GH_TOKEN }}
- run: pnpm dlx "@varlock/bumpy@$BUMPY_VERSION" ci release --expect-mode publish
env:
GH_TOKEN: ${{ github.token }}
BUMPY_GH_TOKEN: ${{ secrets.BUMPY_GH_TOKEN }}
verify:
needs: publish
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
package-manager-cache: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- run: pnpm run release:verify
env:
GH_TOKEN: ${{ github.token }}