This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
209 lines (199 loc) · 6.9 KB
/
Copy pathrelease.yml
File metadata and controls
209 lines (199 loc) · 6.9 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: Release
# This action runs on push to 'main' and below specified paths
on:
push:
branches:
- main
paths:
- "desktop/package.json"
jobs:
release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag-version-commit.outputs.tag }}
steps:
- uses: passy/extract-version-commit@v1.0.0
id: extract-version-commit
with:
version_regex: '^Flipper Release: v([0-9]+\.[0-9]+\.[0-9]+)(?:\n|$)'
- uses: actions/checkout@v3.5.3
if: ${{ steps.extract-version-commit.outputs.commit != ''}}
with:
ref: ${{ steps.extract-version-commit.outputs.commit }}
- name: Tag version commit
if: ${{ steps.extract-version-commit.outputs.commit != ''}}
id: tag-version-commit
uses: passy/tag-version-commit@v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ steps.extract-version-commit.outputs.commit }}
version_tag_prefix: "v"
version_assertion_command: 'grep -q "\"version\": \"$version\"" desktop/package.json'
- name: Create release
if: ${{ steps.tag-version-commit.outputs.tag != '' }}
uses: softprops/action-gh-release@v0.1.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag-version-commit.outputs.tag }}
name: ${{ steps.tag-version-commit.outputs.tag }}
body: |
See https://github.com/facebook/flipper/blob/main/desktop/static/CHANGELOG.md
for full notes.
draft: false
prerelease: false
build-server-mac:
needs:
- release
runs-on: macos-latest
env:
desktop-directory: ./desktop
steps:
- uses: actions/checkout@v3.5.3
with:
ref: ${{ needs.release.outputs.tag }}
- uses: actions/setup-node@v3.6.0
with:
node-version: "18.x"
- name: Install
uses: nick-invision/retry@v2.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: cd ${{env.desktop-directory}} && yarn
- name: Build
run: cd ${{env.desktop-directory}} && yarn build:flipper-server --mac --dmg --linux --win --tar
- name: List dist artifacts
run: ls -l dist/
- name: Upload Mac x86-64
uses: actions/upload-artifact@v4
with:
name: "Flipper-server-mac-x64.dmg"
path: "dist/Flipper-server-mac-x64.dmg"
- name: Upload Mac aarch64
uses: actions/upload-artifact@v4
with:
name: "Flipper-server-mac-aarch64.dmg"
path: "dist/Flipper-server-mac-aarch64.dmg"
- name: Upload Linux x64
uses: actions/upload-artifact@v4
with:
name: "flipper-server-linux.tar.gz"
path: "dist/flipper-server-linux.tar.gz"
- name: Upload Windows x64
uses: actions/upload-artifact@v4
with:
name: "flipper-server-windows.tar.gz"
path: "dist/flipper-server-windows.tar.gz"
build-flipper-server:
needs:
- release
runs-on: ubuntu-latest
env:
desktop-directory: ./desktop
steps:
- uses: actions/checkout@v3.5.3
with:
ref: ${{ needs.release.outputs.tag }}
- uses: actions/setup-node@v3.6.0
with:
node-version: "18.x"
- name: Install
uses: nick-invision/retry@v2.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: cd ${{env.desktop-directory}} && yarn
- name: Build
run: cd ${{env.desktop-directory}} && yarn build:flipper-server
- name: List dist artifacts
run: ls -l dist/
- name: Upload flipper-server
uses: actions/upload-artifact@v4
with:
name: "flipper-server.tgz"
path: "dist/flipper-server.tgz"
publish:
needs:
- build-server-mac
- build-flipper-server
- release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
with:
ref: ${{ needs.release.outputs.tag }}
- name: Download Flipper Server x86-64
if: ${{ needs.release.outputs.tag != '' }}
uses: actions/download-artifact@v4
with:
name: "Flipper-server-mac-x64.dmg"
path: "Flipper-server-mac-x64.dmg"
- name: Download Flipper Server aarch64
if: ${{ needs.release.outputs.tag != '' }}
uses: actions/download-artifact@v4
with:
name: "Flipper-server-mac-aarch64.dmg"
path: "Flipper-server-mac-aarch64.dmg"
- name: Download Flipper Server
if: ${{ needs.release.outputs.tag != '' }}
uses: actions/download-artifact@v4
with:
name: "flipper-server.tgz"
path: "flipper-server.tgz"
- name: GitHub Upload Release Artifacts
if: ${{ needs.release.outputs.tag != '' }}
uses: softprops/action-gh-release@v0.1.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.release.outputs.tag }}
fail_on_unmatched_files: true
files: |
flipper-server.tgz/flipper-server.tgz
Flipper-server-mac-x64.dmg/Flipper-server-mac-x64.dmg
Flipper-server-mac-aarch64.dmg/Flipper-server-mac-aarch64.dmg
- name: Set up npm token
if: ${{ needs.release.outputs.tag != '' && github.repository == 'facebook/flipper' }}
run: echo "//registry.yarnpkg.com/:_authToken=${{ secrets.FLIPPER_NPM_TOKEN }}" >> ~/.npmrc
- name: Publish flipper-server on NPM
if: ${{ needs.release.outputs.tag != '' && github.repository == 'facebook/flipper' }}
run: |
tar zxvf flipper-server.tgz/flipper-server.tgz
cd package
yarn publish
- name: Open issue on failure
if: failure()
uses: JasonEtco/create-an-issue@v2.9.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
WORKFLOW_NAME: "Publish"
with:
filename: .github/action-failure-template.md
dispatch:
if: ${{ github.repository == 'facebook/flipper' }}
needs:
- release
runs-on: ubuntu-latest
steps:
- name: Publish Workflow Dispatch
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/workflow-dispatch@v1.2.2
with:
workflow: Publish Pods
ref: ${{ needs.release.outputs.tag }}
- name: Publish NPM
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/workflow-dispatch@v1.2.2
with:
workflow: Publish NPM
ref: ${{ needs.release.outputs.tag }}
- name: Publish Android
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/workflow-dispatch@v1.2.2
with:
workflow: Publish Android
ref: ${{ needs.release.outputs.tag }}
inputs: '{"tag": "${{ needs.release.outputs.tag }}"}'