-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 1.5 KB
/
release.yml
File metadata and controls
60 lines (50 loc) · 1.5 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for git history and changelog generation
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Install gcx
run: |
go build -o /usr/local/bin/gcx ./cmd/gcx
chmod +x /usr/local/bin/gcx
- name: Build release binaries
run: gcx build --config gcx.release.yaml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ github.actor }}/gcx:latest
${{ github.actor }}/gcx:${{ github.ref_name }}
build-args: |
VERSION=${{ github.ref_name }}
COMMIT=${{ github.sha }}
- name: Create GitHub Release
run: |
changelog=$(gcx release changelog --stable)
gh release create ${{ github.ref_name }} ./dist/* --notes "$changelog" --title ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}