-
-
Notifications
You must be signed in to change notification settings - Fork 9
77 lines (66 loc) · 2.15 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
name: Release
on:
push:
branches:
- release
jobs:
build-and-publish-mac-linux:
if: false
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
arch: [x64, arm64]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build Electron app
run: |
npm run make -- --arch=${{ matrix.arch }}
env:
ELECTRON_CACHE: ${{ runner.temp }}/electron
npm_config_arch: ${{ matrix.arch }}
npm_config_platform: ${{ matrix.os == 'macos-latest' && 'darwin' || 'linux' }}
- name: Extract version from package.json
run: |
VERSION=$(node -e "console.log(require('./package.json').version);")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Upload files to Cloudflare R2
run: |
for file in $(find out/make/ -type f); do
echo "Uploading $(basename "$file")"
aws s3 cp "$file" "s3://${{ secrets.R2_BUCKET }}/releases/v${{ env.VERSION }}/$(basename "$file")" \
--endpoint-url="${{ secrets.R2_ENDPOINT }}" --debug
done
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.R2_REGION }}
create-release:
if: false
needs: [build-and-publish-mac-linux]
runs-on: ubuntu-latest
steps:
- name: Extract version from package.json
run: |
VERSION=$(node -e "console.log(require('./package.json').version);")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
body: |
Changes in this Release
draft: true
prerelease: false