-
Notifications
You must be signed in to change notification settings - Fork 23
93 lines (84 loc) · 2.71 KB
/
release.yml
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
name: Release
on:
push:
branches:
- main
paths:
- 'packages/**'
- 'package.json'
- '!**/README.md'
workflow_run:
workflows:
- .bumpfile
branches:
- main
types:
- completed
workflow_dispatch:
env:
NODE_VERSION: 20
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Release Please
uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
outputs:
releases-created: ${{ steps.release.outputs.releases_created }}
package-name: ${{ (
(steps.release.outputs['packages/create-minze--release_created'] && 'create-minze') ||
(steps.release.outputs['packages/minze--release_created'] && 'minze') ||
(steps.release.outputs['packages/minze-vscode--release_created'] && 'minze-vscode') ||
(steps.release.outputs['packages/vite-plugin-minze--release_created'] && 'vite-plugin-minze')
) }}
bump-lockfile:
needs:
- release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.releases-created }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main # needs to be explicitly set to pull the latest changes
- name: Bump lock file
uses: ./.github/actions/bump-lockfile
with:
node-version: ${{ env.NODE_VERSION }}
publish-npm:
needs:
- release-please
- bump-lockfile
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.releases-created && needs.release-please.outputs.package-name != 'minze-vscode' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main # needs to be explicitly set to pull the latest changes
- name: Publish to npm
uses: ./.github/actions/publish-npm
with:
node-version: ${{ env.NODE_VERSION }}
package-name: ${{ needs.release-please.outputs.package-name }}
npm-token: ${{ secrets.NPM_TOKEN }}
publish-vs-marketplace:
needs:
- release-please
- bump-lockfile
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.releases-created && needs.release-please.outputs.package-name == 'minze-vscode' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main # needs to be explicitly set to pull the latest changes
- name: Publish to VS Marketplace
uses: ./.github/actions/publish-vs-marketplace
with:
node-version: ${{ env.NODE_VERSION }}
package-name: ${{ needs.release-please.outputs.package-name }}
vs-marketplace-token: ${{ secrets.VS_MARKETPLACE_TOKEN }}