-
Notifications
You must be signed in to change notification settings - Fork 4
144 lines (123 loc) · 4.95 KB
/
deno.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will install Deno then run Deno lint and test.
# For more information see: https://github.com/denoland/setup-deno
name: Deno
on:
push:
tags:
- v*.*.*
# push:
# branches: [chenbishop-patch-1]
jobs:
build_release:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v1
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- id: get_version
uses: battila7/get-version-action@v2
# - name: Test Deno
# run: deno run https://deno.land/std/examples/welcome.ts
- name: Compile
run: |
sed -i 's/LATEST/${{ steps.get_version.outputs.version-without-v }}/g' ./version.js
deno -V
deno cache --reload ./tg.js --unstable
deno compile --allow-all --import-map ./import_map.json --unstable ./tg.js
mkdir -p dist/linux/x86_64 dist/win/x86_64 dist/macos/x86_64 dist/macos/aarch64
deno bundle --unstable --import-map ./import_map.json ./tg.js ./tg.bundle.js
deno compile --allow-all --unstable --target x86_64-unknown-linux-gnu --output ./dist/linux/x86_64/tg ./tg.bundle.js &
deno compile --allow-all --unstable --target x86_64-pc-windows-msvc --output ./dist/win/x86_64/tg ./tg.bundle.js &
deno compile --allow-all --unstable --target x86_64-apple-darwin --output ./dist/macos/x86_64/tg ./tg.bundle.js &
deno compile --allow-all --unstable --target aarch64-apple-darwin --output ./dist/macos/aarch64/tg ./tg.bundle.js &
- name: create package directory amd64
run: |
mkdir -p .debpkg/usr/bin
cp ./dist/linux/x86_64/tg .debpkg/usr/bin/tg
ls -l .debpkg/usr/bin/tg
chmod 755 .debpkg/usr/bin/tg
- uses: jiro4989/build-deb-action@v2
with:
package: tgcli
package_root: .debpkg
maintainer: twingate_lab
version: ${{ github.ref }} # refs/tags/v*.*.*
arch: 'amd64'
desc: 'This is a command line application demonstrating various usages of the Twingate API.'
- name: Compress cli_linux_x86_64
uses: papeloto/action-zip@v1
with:
files: ./dist/linux/x86_64/tg
dest: ./cli_linux_x86_64.zip
- name: Compress cli_win_x86_64
uses: papeloto/action-zip@v1
with:
files: ./dist/win/x86_64/tg.exe
dest: ./cli_win_x86_64.zip
- name: Compress cli_macos_x86_64
uses: papeloto/action-zip@v1
with:
files: ./dist/macos/x86_64/tg
dest: ./cli_macos_x86_64.zip
- name: Compress cli_macos_aarch64
uses: papeloto/action-zip@v1
with:
files: ./dist/macos/aarch64/tg
dest: ./cli_macos_aarch64.zip
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload linux_x86_64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: cli_linux_x86_64.zip
asset_name: cli_linux_x86_64.zip
asset_content_type: application/zip
- name: Upload cli_win_x86_64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: cli_win_x86_64.zip
asset_name: cli_win_x86_64.zip
asset_content_type: application/zip
- name: Upload cli_macos_x86_64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: cli_macos_x86_64.zip
asset_name: cli_macos_x86_64.zip
asset_content_type: application/zip
- name: Upload cli_macos_aarch64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: cli_macos_aarch64.zip
asset_name: cli_macos_aarch64.zip
asset_content_type: application/zip
- name: Upload tgcli_debian
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: tgcli_${{ steps.get_version.outputs.version-without-v }}_amd64.deb
asset_name: tgcli_${{ steps.get_version.outputs.version-without-v }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package