-
Notifications
You must be signed in to change notification settings - Fork 86
154 lines (132 loc) · 4.6 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
name: Build and Release fideo
on:
push:
branches:
- release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install PNPM
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Get version from package.json
id: get_version
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $env:GITHUB_ENV
- name: Build Electron App
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
pnpm build:win
elif [ "${{ runner.os }}" == "macOS" ]; then
pnpm build:mac
fi
shell: bash
# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: fideo-${{ runner.os }}
# path: |
# dist/*.exe
# dist/*.dmg
- name: Archive Windows build artifacts
if: ${{ runner.os == 'Windows' }}
run: |
$version = "${{ env.VERSION }}"
Compress-Archive -Path dist/fideo-$version.exe -DestinationPath fideo-win-$version.zip
shell: pwsh
- name: Archive macOS build artifacts (x64)
if: ${{ runner.os == 'macOS' }}
run: tar -czf fideo-mac-x64-${{ env.VERSION }}.tar.gz dist/fideo-${{ env.VERSION }}-x64.dmg
- name: Archive macOS build artifacts (arm)
if: ${{ runner.os == 'macOS' }}
run: tar -czf fideo-mac-arm-${{ env.VERSION }}.tar.gz dist/fideo-${{ env.VERSION }}-arm64.dmg
- name: Upload Windows build artifact
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v4
with:
name: build-win-${{ env.VERSION }}
path: fideo-win-${{ env.VERSION }}.zip
- name: Upload macOS build artifacts (x64)
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v4
with:
name: build-mac-x64-${{ env.VERSION }}
path: fideo-mac-x64-${{ env.VERSION }}.tar.gz
- name: Upload macOS build artifacts (arm)
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v4
with:
name: build-mac-arm-${{ env.VERSION }}
path: fideo-mac-arm-${{ env.VERSION }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from package.json
id: get_version
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
- name: Download Windows build artifact
uses: actions/download-artifact@v2
with:
name: build-win-${{ env.VERSION }}
path: .
- name: Download macOS build artifacts (x64)
uses: actions/download-artifact@v2
with:
name: build-mac-x64-${{ env.VERSION }}
path: .
- name: Download macOS build artifacts (arm)
uses: actions/download-artifact@v2
with:
name: build-mac-arm-${{ env.VERSION }}
path: .
# - name: Create Release
# id: create_release
# uses: elgohr/Github-Release-Action@v5
# env:
# GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# with:
# tag_name: v${{ env.VERSION }}
# release_name: Release v${{ env.VERSION }}
# draft: false
# prerelease: false
# - name: Upload Windows Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: fideo-${{ env.VERSION }}.exe
# asset_name: fideo-${{ env.VERSION }}.exe
- name: Upload macOS Release Asset (x64)
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
files: |
fideo-mac-x64-${{ env.VERSION }}.tar.gz
fideo-mac-arm-${{ env.VERSION }}.tar.gz
fideo-win-${{ env.VERSION }}.zip
tag_name: v${{ env.VERSION }}
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist/fideo-${{ env.VERSION }}-x64.dmg
# asset_name: fideo-${{ env.VERSION }}-x64.dmg
# - name: Upload macOS Release Asset (arm)
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist/fideo-${{ env.VERSION }}-arm64.dmg
# asset_name: dist/fideo-${{ env.VERSION }}-arm64.dmg