-
Notifications
You must be signed in to change notification settings - Fork 5
92 lines (85 loc) · 2.75 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
name: Release
permissions:
contents: write
on:
push:
tags:
- 'v[0-9]*.*.*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
# 22.04 is the earliest version with OpenSSL 3
runs-on: ubuntu-22.04
env:
AW_WEBUI_DIR: ${{ github.workspace }}/aw-webui/dist
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-11-01
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl
sudo apt-get install build-essential -y
sudo apt-get install libdbus-1-dev -y
sudo apt-get install libssl-dev -y
sudo apt-get install pkg-config -y
- name: install cargo-deb
run: cargo install cargo-deb
# Build aw-webui
- name: Checkout aw-webui
uses: actions/checkout@v3
with:
repository: ActivityWatch/aw-webui
path: aw-webui
ref: 839366e66f859faadd7f9128de3bea14b25ce4ae
submodules: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Copy logo
run: cp media/logo/logo.png static/
working-directory: aw-webui
- run: npm ci
working-directory: aw-webui
- run: npm run build
working-directory: aw-webui
# Buil and upload binaries
- uses: Swatinem/rust-cache@v2
- name: cargo build bundle
run: cargo build --release --features=bundle
- run: zip "awatcher-bundle.zip" awatcher
working-directory: target/release
- name: Upload awatcher-bundle to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/awatcher-bundle.zip
- name: cargo build bare
run: cargo build --release
- run: mv awatcher aw-awatcher
working-directory: target/release
- run: zip "aw-awatcher.zip" "aw-awatcher"
working-directory: target/release
- name: Upload awatcher to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/aw-awatcher.zip
- run: cargo deb --variant=bundle
- name: Upload bundle deb to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: target/debian/awatcher*.deb
- run: cargo deb --variant=module
- name: Upload module deb to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: target/debian/aw-awatcher*.deb