This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 954
203 lines (193 loc) · 6.66 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
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
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/[email protected]
id: extract-version-commit
with:
version_regex: '^Flipper Release: v([0-9]+\.[0-9]+\.[0-9]+)(?:\n|$)'
- uses: actions/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
with:
ref: ${{ needs.release.outputs.tag }}
- uses: actions/[email protected]
with:
node-version: "18.x"
- name: Install
uses: nick-invision/[email protected]
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/[email protected]
with:
ref: ${{ needs.release.outputs.tag }}
- uses: actions/[email protected]
with:
node-version: "18.x"
- name: Install
uses: nick-invision/[email protected]
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/[email protected]
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: aigoncharov/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
created_tag: ${{ needs.release.outputs.tag }}
args: 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
run: echo "//registry.yarnpkg.com/:_authToken=${{ secrets.FLIPPER_NPM_TOKEN }}" >> ~/.npmrc
- name: Publish flipper-server on NPM
if: ${{ needs.release.outputs.tag != '' }}
run: |
tar zxvf flipper-server.tgz/flipper-server.tgz
cd package
yarn publish
- name: Open issue on failure
if: failure()
uses: JasonEtco/[email protected]
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:
needs:
- release
runs-on: ubuntu-latest
steps:
- name: Publish Workflow Dispatch
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/[email protected]
with:
workflow: Publish Pods
ref: ${{ needs.release.outputs.tag }}
- name: Publish NPM
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/[email protected]
with:
workflow: Publish NPM
ref: ${{ needs.release.outputs.tag }}
- name: Publish Android
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/[email protected]
with:
workflow: Publish Android
ref: ${{ needs.release.outputs.tag }}
inputs: '{"tag": "${{ needs.release.outputs.tag }}"}'