-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
140 lines (114 loc) · 3.88 KB
/
build-desktop-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
# This is a basic workflow to help you get started with Actions
name: Build-Desktop-Release
on:
workflow_dispatch:
inputs:
tag-name:
description: "Release Tag Name"
required: true
git-ref:
description: "Release Git Ref"
required: true
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 1.8
- name: Install clojure
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.1.763.sh
chmod +x linux-install-1.10.1.763.sh
sudo ./linux-install-1.10.1.763.sh
- name: Build/release Electron app
run: yarn install && yarn release-electron
- name: List files
run: du -a static/out
- name: Change artifact name
run: mv static/out/make/zip/linux/x64/logseq-linux-x64-*.zip static/out/make/zip/linux/x64/Logseq-linux.zip
- name: Cache Artifact
uses: actions/upload-artifact@v1
with:
name: Logseq-linux.zip
path: static/out/make/zip/linux/x64/Logseq-linux.zip
build-windows:
runs-on: windows-latest
steps:
- name: List file
run: Dir .
build-macos:
runs-on: macos-latest
steps:
- name: Check out Git Repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Brew & Clojure
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install clojure/tools/clojure
- name: Build/Release Electron app
run: yarn install && yarn release-electron
- name: Change Artifact Name
run: mv static/out/make/Logseq.dmg static/out/make/Logseq-x86.dmg
- name: Cache Artifact
uses: actions/upload-artifact@v1
with:
name: Logseq-x64.dmg
path: static/out/make/Logseq-x86.dmg
release:
needs: [ build-macos, build-linux, build-windows ]
runs-on: ubuntu-latest
steps:
- name: Download The MacOS X64 Asset
uses: actions/download-artifact@v1
with:
name: Logseq-x64.dmg
path: ./
- name: Download The Linux Asset
uses: actions/download-artifact@v1
with:
name: Logseq-linux.zip
path: ./
- name: List file
run: ls -rl
- name: Create Release Draft
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag-name }}
release_name: TEST CI (DON'T DOWNLOAD) ${{ github.event.inputs.tag-name }}
draft: true
prerelease: true
- name: Upload MacOS X64 Artifact
id: upload-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: ./Logseq-x64.dmg
asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-name }}.dmg
asset_content_type: application/x-apple-diskimage
- name: Upload Linux Artifact
id: upload-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: ./Logseq-linux.zip
asset_name: logseq-linux-x64-${{ github.event.inputs.tag-name }}.zip
asset_content_type: application/zip