-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (70 loc) · 2.46 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (70 loc) · 2.46 KB
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
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build Binaries
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: '2.4.1'
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Build binaries
run: |
# Ensure dist directory exists
mkdir -p dist
# Set version environment variable for the binary
export GATEWAY_CLI_VERSION=${{ env.VERSION }}
# Build all platforms
deno task compile:linux
deno task compile:macos
deno task compile:windows
- name: Rename binaries with version info
run: |
cd dist
mv gateway-cli-linux gateway-cli-linux-${{ env.VERSION }}
mv gateway-cli-macos gateway-cli-macos-${{ env.VERSION }}
mv gateway-cli-windows.exe gateway-cli-windows-${{ env.VERSION }}.exe
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: gateway-cli v${{ env.VERSION }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
body: |
## gateway-cli v${{ env.VERSION }}
### Changes in this release
- See the [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details
### Installation
Download the appropriate binary for your system and make it executable:
#### Linux
```bash
chmod +x gateway-cli-linux-${{ env.VERSION }}
./gateway-cli-linux-${{ env.VERSION }}
```
#### macOS
```bash
chmod +x gateway-cli-macos-${{ env.VERSION }}
./gateway-cli-macos-${{ env.VERSION }}
```
#### Windows
Double-click the executable or run from command line:
```
gateway-cli-windows-${{ env.VERSION }}.exe
```
files: |
dist/gateway-cli-linux-${{ env.VERSION }}
dist/gateway-cli-macos-${{ env.VERSION }}
dist/gateway-cli-windows-${{ env.VERSION }}.exe
- name: Output Release URL
run: echo "Release URL -> ${{ steps.create_release.outputs.url }}"