-
-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (131 loc) · 4.95 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
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
name: Release
on:
workflow_dispatch:
jobs:
prepare_release:
name: Release
outputs:
commit_id: ${{ steps.release_commit.outputs.commit_id }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Create release commit
id: release_commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git rev-parse HEAD
yarn release
git rev-parse HEAD
echo "COMMIT_ID=`git rev-parse HEAD`" >> $GITHUB_ENV
echo "LATEST_TAG=`git describe --tags --abbrev=0`" >> $GITHUB_ENV
echo "::set-output name=commit_id::$release_commit"
- name: Create GH Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.LATEST_TAG }}
release_name: ${{ env.LATEST_TAG }}
draft: true
prerelease: true
release_ubuntu:
name: Release (Ubuntu)
runs-on: 'ubuntu-latest'
needs: [prepare_release]
steps:
- name: Checkout Latest
uses: actions/checkout@v1
- name: Package (Ubuntu)
run: |
yarn install --frozen-lockfile
yarn make
ls -R out/
tar -zcvf katibu-linux-x64.tar.gz out/katibu-linux-x64
echo "DEB_ASSET_NAME=`find out/make/deb/x64/ -name "*.deb" -exec basename {} \;`" >> $GITHUB_ENV
echo "RPM_ASSET_NAME=`find out/make/rpm/x64/ -name "*.rpm" -exec basename {} \;`" >> $GITHUB_ENV
- name: Upload Release Asset (Ubuntu - deb)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: './out/make/deb/x64/${{ env.DEB_ASSET_NAME }}'
asset_name: ${{ env.DEB_ASSET_NAME }}
asset_content_type: application/vnd.debian.binary-package
- name: Upload Release Asset (Ubuntu - raw)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: './katibu-linux-x64.tar.gz'
asset_name: katibu-linux-x64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset (Ubuntu - rpm)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: './out/make/rpm/x64/${{ env.RPM_ASSET_NAME }}'
asset_name: ${{ env.RPM_ASSET_NAME }}
asset_content_type: application/x-rpm
release_macos:
name: Release (MacOS)
runs-on: 'macos-latest'
needs: [prepare_release]
steps:
- name: Checkout Latest
uses: actions/checkout@v1
- name: Package (MacOS)
run: |
yarn install --frozen-lockfile
yarn make
ls -R out/make
echo "ZIP_ASSET_NAME=`find out/make/zip/darwin/x64/ -name "*.zip" -exec basename {} \;`" >> $GITHUB_ENV
- name: Upload Release Asset (MacOS - zip)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: './out/make/zip/darwin/x64/${{ env.ZIP_ASSET_NAME }}'
asset_name: ${{ env.ZIP_ASSET_NAME }}
asset_content_type: application/zip
release_win:
name: Release (Win)
runs-on: 'windows-latest'
needs: [prepare_release]
steps:
- name: Checkout Latest
uses: actions/checkout@v1
- name: Package (Win)
run: |
yarn install --frozen-lockfile
curl -OLS https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311.exe
.\wix311.exe /install /quiet /norestart
$wixPath='"' + "C:\Program Files (x86)\WiX Toolset v3.11\bin\" +'"'
$ENV:PATH="$ENV:PATH;$wixPath"
yarn make
ls -R out/make
$result=Get-ChildItem -Path out\make\wix\x64 -include *.msi -Name
echo "MSI_ASSET_NAME=$result" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload Release Asset (Win - zip)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare_release.outputs.upload_url }}
asset_path: './out/make/wix/x64/${{ env.MSI_ASSET_NAME }}'
asset_name: ${{ env.MSI_ASSET_NAME }}
asset_content_type: application/octet-stream