-
Notifications
You must be signed in to change notification settings - Fork 172
134 lines (114 loc) · 3.71 KB
/
release.yml
File metadata and controls
134 lines (114 loc) · 3.71 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
id-token: write
contents: write
jobs:
is_release:
name: Is release?
runs-on: ubuntu-latest
outputs:
release: ${{ steps.version.outputs.release }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Parse .tool-versions
uses: wistia/parse-tool-versions@v2.1.1
id: tool-versions
with:
filename: '.tool-versions'
uppercase: 'true'
prefix: 'tool_version_'
- name: Install pnpm
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: ${{ env.TOOL_VERSION_PNPM }}
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
registry-url: "https://registry.npmjs.org"
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Configure pnpm
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check if new version
id: version
run: |
IS_RELEASE=$(./.github/scripts/is_release.sh)
echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
changes:
name: Repository changes
needs: [is_release]
if: needs.is_release.outputs.release == 'true'
runs-on: ubuntu-latest
outputs:
js-sdk: ${{ steps.js.outputs.release }}
python-sdk: ${{ steps.python.outputs.release }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Parse .tool-versions
uses: wistia/parse-tool-versions@v2.1.1
id: tool-versions
with:
filename: '.tool-versions'
uppercase: 'true'
prefix: 'tool_version_'
- name: Install pnpm
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: ${{ env.TOOL_VERSION_PNPM }}
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Configure pnpm
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check JavasScript SDK Release
id: js
run: |
IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "@e2b/desktop")
echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
- name: Check Python SDK Release
id: python
run: |
IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "@e2b/desktop-python")
echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
publish:
name: Publish
needs: [is_release]
if: (!cancelled()) && !contains(needs.*.result, 'failure') && needs.is_release.outputs.release == 'true'
uses: ./.github/workflows/publish_packages.yml
secrets: inherit
report-failure:
needs: [publish]
if: failure()
name: Release Failed - Slack Notification
runs-on: ubuntu-latest
steps:
- name: Release Failed - Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#ff0000'
SLACK_MESSAGE: ':here-we-go-again: :bob-the-destroyer: We need :fix-parrot: ASAP :pray:'
SLACK_TITLE: Release Failed
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'monitoring-releases'