-
Notifications
You must be signed in to change notification settings - Fork 24
161 lines (153 loc) · 5.41 KB
/
ci.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
name: CI
# Events that trigger workflow
on:
push:
branches:
- "*"
pull_request:
jobs:
windows:
name: Build (Windows)
runs-on: windows-2019
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Export Repo URL
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV
- name: Export Branch Name
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Clone Submodules
run: git submodule update --init
- name: Build Distribution
shell: pwsh
run: |
yarn
yarn build
cd .\dist
Compress-Archive *.exe .\nudelta-amd64.exe.zip
cp .\nudelta-amd64.exe.zip ..
- name: Upload App
uses: actions/upload-artifact@v3
with:
name: win-app
path: ./nudelta-amd64.exe.zip
linux:
name: Build (Linux)
runs-on: ubuntu-20.04
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Export Repo URL
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV
- name: Export Branch Name
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Clone Submodules
run: git submodule update --init
- name: Build Distribution
run: |
docker build -t appimage-build .
id=$(docker create appimage-build) ; \
docker cp $id:/nudelta.AppImage nudelta-amd64.AppImage ; \
docker rm -v $id
- name: Upload AppImage
uses: actions/upload-artifact@v3
with:
name: linux-appimage
path: ./nudelta-amd64.AppImage
macos:
name: Build (macOS)
runs-on: macos-11
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Export Repo URL
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV
- name: Export Branch Name
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Clone Submodules
run: git submodule update --init
- name: Get Cmake
run: |
brew install cmake
- name: Build Distribution
run: |
yarn
yarn build
cp -r ./dist/*.dmg ./nudelta-universal.app.dmg
- name: Upload App
uses: actions/upload-artifact@v3
with:
name: mac-app
path: ./nudelta-universal.app.dmg
publish:
name: Publish
runs-on: ubuntu-20.04
needs: [macos, linux, windows]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Export Repo URL
run: echo "REPO_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV
- name: Export Branch Name
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set default for env.NEW_TAG
run: echo "NEW_TAG=NO_NEW_TAG" >> $GITHUB_ENV
- name: Download Linux App
uses: actions/download-artifact@v3
with:
name: linux-appimage
path: /tmp
- name: Download Mac App
uses: actions/download-artifact@v3
with:
name: mac-app
path: /tmp
- name: Download Windows App
uses: actions/download-artifact@v3
with:
name: win-app
path: /tmp
- name: Check for new version
if: ${{ env.BRANCH_NAME == 'main' }}
run: |
cd ${GITHUB_WORKSPACE}/ && python3 .github/scripts/generate_tag.py
- name: Tag Commit
if: ${{ env.NEW_TAG != 'NO_NEW_TAG' }}
uses: tvdias/[email protected]
with:
tag: "${{ env.NEW_TAG }}"
repo-token: "${{ secrets.MY_TOKEN }}"
- name: Upload Release Asset
if: ${{ env.NEW_TAG != 'NO_NEW_TAG' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.NEW_TAG }}
body: >
Changelog: https://github.com/donn/nudelta/blob/main/Changelog.md
![Screencap](https://raw.githubusercontent.com/donn/nudelta/main/res/screencap.png)
A Windows `.exe`, a macOS `.app` and a Linux `.AppImage` have all been built.
On Windows, you will need to download and unzip the `.exe` file.
You may see a Windows SmartScreen warning- you can safely ignore it.
On macOS, you will need to download the `.dmg` file, drag it into
your Applications folder, then **Right-click > Open** the app on
macOS. The app is not code-signed or notarized, and while it is
universal, writing only works on x86-64
(see: https://github.com/donn/nudelta/issues/37).
Use at your own risk.
On Linux, download the `.AppImage`, enable "allow executing file as
program" in its properties (shown below), then double-click it.
* You may need to install `libudev` separately- on Ubuntu, you can
run `sudo apt-get install -y libudev`.
![Setting Linux execute permission with the GNOME File Browser](https://raw.githubusercontent.com/donn/nudelta/main/res/linux_exec_permission.png)
files: |
/tmp/nudelta-universal.app.dmg
/tmp/nudelta-amd64.exe.zip
/tmp/nudelta-amd64.AppImage