-
Notifications
You must be signed in to change notification settings - Fork 15
168 lines (165 loc) · 5.63 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
name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
jobs:
# build:
# name: release ${{ matrix.target }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# target:
# [
# x86_64-pc-windows-gnu,
# x86_64-unknown-linux-musl
# ]
# package: [web, deploy]
# steps:
# - uses: actions/checkout@master
# - name: Compile and release
# id: compile
# uses: rust-build/rust-build.action@v1.3.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# RUSTTARGET: ${{ matrix.target }}
# SRC_DIR: ${{ matrix.package }}
# ARCHIVE_NAME: serverbee-${{ matrix.package }}-${{ matrix.target }}
# UPLOAD_MODE: none
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: serverbee-${{ matrix.target }}
# path: |
# ${{ steps.compile.outputs.BUILT_ARCHIVE }}
# ${{ steps.compile.outputs.BUILT_CHECKSUM }}
build-view:
name: Build View
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install dependencies and build
run: |
pnpm -C apps/view install
pnpm -C apps/view build
- name: Upload view build artifacts
uses: actions/upload-artifact@v2
with:
name: view-build-artifacts
path: apps/view/dist
build:
needs:
- build-view
strategy:
fail-fast: false
matrix:
package: [ web, deploy ]
settings:
- host: macos-latest
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
- host: ubuntu-latest
suffix: .exe
target: x86_64-pc-windows-gnu
- host: windows-latest
suffix: .exe
target: x86_64-pc-windows-msvc
args: --no-default-features --features native-tls
# https://github.com/briansmith/ring/issues/1614
# - host: windows-latest
# suffix: .exe
# target: aarch64-pc-windows-msvc
# args: --no-default-features --features native-tls
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
name: build serverbee-${{ matrix.package }}-${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@master
- name: Download view build artifacts
uses: actions/download-artifact@v2
if: matrix.package == 'web'
with:
name: view-build-artifacts
path: apps/view/dist
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: ${{ matrix.settings.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --bin serverbee-${{ matrix.package }} --target ${{ matrix.settings.target }} ${{ matrix.settings.args }}
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
type: 'zip'
directory: ./target/${{ matrix.settings.target }}/release
path: serverbee-${{ matrix.package }}${{ matrix.settings.suffix }}
filename: serverbee-${{ matrix.package }}-${{ matrix.settings.target }}.zip
# - name: Display structure of Upload files
# run: ls -R
# - name: Upload to R2
# uses: randomairborne/r2-release@main
# with:
# endpoint: ${{ secrets.S3_ENDPOINT }}
# accesskeyid: ${{ secrets.S3_ACCESS_KEY_ID }}
# secretaccesskey: ${{ secrets.S3_SECRET_ACCESS_KEY }}
# bucket: serverbee
# file: ./target/${{ matrix.settings.target }}/release/serverbee-${{ matrix.package }}-${{ matrix.settings.target }}.zip
# destination: cli/${{ github.ref_name }}/serverbee-${{ matrix.package }}-${{ matrix.settings.target }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: serverbee-release
path: ./target/${{ matrix.settings.target }}/release/serverbee-${{ matrix.package }}-${{ matrix.settings.target }}.zip
upload-to-r2:
name: Upload Release to R2
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/download-artifact@v3
with:
name: serverbee-release
path: release
- name: Display structure of Upload files
run: ls -R
- uses: ryand56/r2-upload-action@latest
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
r2-bucket: serverbee
source-dir: release
destination-dir: cli/${{ github.ref_name }}
release:
name: Release
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/download-artifact@v3
- uses: ncipollo/release-action@v1
with:
artifacts: 'serverbee-*/*.zip'
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}