-
Notifications
You must be signed in to change notification settings - Fork 11
141 lines (123 loc) · 4.95 KB
/
release-desktop-package.yaml
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
name: Release desktop package
on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
release:
name: Create release
runs-on: ubuntu-latest
# Note this. We are going to use that in further jobs.
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Get tag name
id: tag
run: echo 0.0.1
- name: Create release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 0.0.1
release_name: ${{ steps.tag.outputs.NAME }}
release_assets:
name: Release assets
needs: release # we need to know the upload URL
runs-on: ${{ matrix.config.os }} # we run many different builds
strategy:
matrix:
config:
- os: ubuntu-latest
- os: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Extract package version
id: extract_package_version
uses: Saionaro/extract-package-version@v1.1.1
- name: Install dependencies
if: runner.os != 'Windows'
run: sudo apt-get install -y ruby-dev build-essential && sudo gem install fpm
- name: Install npm modules
run: npm install
- name: Build deb desktop app
run: npm run dist
- name: Build rpm desktop app
if: runner.os == 'Linux'
run: npm run dist:rpm
- name: Create check sum file for deb
if: matrix.config.os == 'ubuntu-latest'
run: sha512sum *.deb > google-chat-linux-SHA512.txt
working-directory: dist
- name: Create check sum file for rpm
if: matrix.config.os == 'ubuntu-latest'
run: sha512sum *.rpm > google-chat-linux-rpm-SHA512.txt
working-directory: dist
- name: Upload deb check sum file to release
if: matrix.config.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: dist/google-chat-linux-SHA512.txt
asset_name: google-chat-linux-SHA512.txt
asset_content_type: text/plain
- name: Upload rpm check sum file to release
if: matrix.config.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: dist/google-chat-linux-rpm-SHA512.txt
asset_name: google-chat-linux-rpm-SHA512.txt
asset_content_type: text/plain
- name: Upload Debian package to release
if: matrix.config.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: dist/google-chat-linux_${{ steps.extract_package_version.outputs.version }}_amd64.deb
asset_name: google-chat-linux_${{ steps.extract_package_version.outputs.version }}_amd64.deb
asset_content_type: application/octet-stream
- name: Upload rpm package to release
if: matrix.config.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: dist/google-chat-linux-${{ steps.extract_package_version.outputs.version }}.x86_64.rpm
asset_name: google-chat-linux-${{ steps.extract_package_version.outputs.version }}.x86_64.rpm
asset_content_type: application/octet-stream
- name: Create Exe check sum file
if: matrix.config.os == 'windows-latest'
run: sha512sum *.exe > google-chat-win-SHA512.txt
working-directory: dist
- name: Upload Exe package to release
if: matrix.config.os == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: dist/google-chat-linux Setup ${{ steps.extract_package_version.outputs.version }}.exe
asset_name: google-chat-linux_Setup_${{ steps.extract_package_version.outputs.version }}.exe
asset_content_type: application/octet-stream
- name: Upload Exe check sum file to release
if: matrix.config.os == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: dist/google-chat-win-SHA512.txt
asset_name: google-chat-win-SHA512.txt
asset_content_type: text/plain