-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (110 loc) · 4.05 KB
/
Copy pathrelease.yml
File metadata and controls
127 lines (110 loc) · 4.05 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
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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: windows
goarch: amd64
platform: windows
arch: x86_64
ext: .exe
- goos: linux
goarch: amd64
platform: linux
arch: x86_64
ext: ""
- goos: linux
goarch: arm64
platform: linux
arch: arm64
ext: ""
- goos: darwin
goarch: amd64
platform: macos
arch: x86_64
ext: ""
- goos: darwin
goarch: arm64
platform: macos
arch: arm64
ext: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.25'
- name: Get tag name
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -ldflags "-X github.com/UnipayFI/aster-cli/cmd.version=${{ steps.tag.outputs.tag }}" -o aster-cli${{ matrix.ext }}
- name: Create package
run: |
mkdir -p dist
tar -czf dist/aster-cli-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz aster-cli${{ matrix.ext }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: aster-cli-${{ matrix.platform }}-${{ matrix.arch }}
path: dist/aster-cli-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get tag name
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
find ./artifacts -name "*.tar.gz" -exec cp {} release-assets/ \;
ls -la release-assets/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: ${{ steps.tag.outputs.tag }}
draft: false
prerelease: false
files: release-assets/*
body: |
## Release ${{ steps.tag.outputs.tag }}
### Downloads
| Platform | Architecture | Download |
|----------|--------------|----------|
| Windows | x86_64 | [aster-cli-windows-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/aster-cli-windows-x86_64.tar.gz) |
| Linux | x86_64 | [aster-cli-linux-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/aster-cli-linux-x86_64.tar.gz) |
| Linux | arm64 | [aster-cli-linux-arm64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/aster-cli-linux-arm64.tar.gz) |
| macOS | x86_64 | [aster-cli-macos-x86_64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/aster-cli-macos-x86_64.tar.gz) |
| macOS | arm64 | [aster-cli-macos-arm64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.tag.outputs.tag }}/aster-cli-macos-arm64.tar.gz) |
### Installation
1. Download the appropriate package for your platform
2. Extract the archive: `tar -xzf aster-cli-{platform}-{arch}.tar.gz`
3. Make executable (Linux/macOS): `chmod +x aster-cli`
4. Set up environment variables:
```bash
export API_KEY="your_api_key"
export API_SECRET="your_api_secret"
```
5. Run: `./aster-cli --help`
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}