-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (79 loc) · 2.45 KB
/
deploy.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
name: Deploy to Github Releases
on:
release:
types: [published]
jobs:
build:
name: Build
strategy:
matrix:
include:
- platform: mac
os: "macos-12"
- platform: linux
os: "ubuntu-22.04"
- platform: windows
os: "windows-2022"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Settp Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install --network-timeout 1000000 # will run `yarn install` command
dir: desktop-app
- name: Update package.json
run: |
./set-version.sh
- name: Build production bundle
uses: borales/actions-yarn@v5
with:
cmd: build # will run `yarn build` command (for each os)
dir: desktop-app
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-distributables
path: desktop-app/dist/Napse-*
if-no-files-found: error
publish:
name: Publish
runs-on: "ubuntu-22.04"
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
- name: Get all distributables
uses: actions/download-artifact@v3
- name: Get distributables
run: |
mkdir distributables
cp -r linux-distributables/* distributables/
cp -r mac-distributables/* distributables/
cp -r windows-distributables/* distributables/
ls distributables
- name: Filter out .blockmap files
run: |
find distributables -name '*.blockmap' -exec rm {} +
- name: Tag Docker image
run: |
TAG_NAME=$(grep -oP '(?<=# \[)[^\]]+' CHANGELOG.md | head -n 1)
VERSION=v$TAG_NAME
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Publish all artifacts to GitHub Releases
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
with:
files: distributables/*
tag_name: ${{ env.VERSION }}
body: ${{ github.event.release.body }}
draft: false
prerelease: false