-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (77 loc) · 2.76 KB
/
release.yml
File metadata and controls
93 lines (77 loc) · 2.76 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
name: Release on Git Tag
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
- name: Build binary for ${{ matrix.goos }}-${{ matrix.goarch }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
BINARY_NAME="req-${{ env.VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}"
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
go build -ldflags "-X main.Version=${{ env.VERSION }}" -o "${BINARY_NAME}" .
echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}
path: ${{ env.BINARY_NAME }}
create-release:
needs: release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./binaries
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.VERSION }}
name: "Req ${{ env.VERSION }}"
body: |
A terminal-based API client built for the Boot.dev Hackathon 2025.
**Installation:**
```bash
go install github.com/maniac-en/req@${{ env.VERSION }}
```
**Prebuilt binaries:**
- Linux: `req-${{ env.VERSION }}-linux-amd64`, `req-${{ env.VERSION }}-linux-arm64`
- macOS: `req-${{ env.VERSION }}-darwin-amd64`, `req-${{ env.VERSION }}-darwin-arm64`
- Windows: `req-${{ env.VERSION }}-windows-amd64.exe`
**Usage:** Run `req` in your terminal
**Note:** This is early development software. Core HTTP execution features are still in progress.
Full changelog: https://github.com/maniac-en/req/commits/${{ env.VERSION }}
files: ./binaries/**/*
draft: false
prerelease: ${{ contains(env.VERSION, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}