-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (97 loc) · 2.99 KB
/
Copy pathrelease.yml
File metadata and controls
102 lines (97 loc) · 2.99 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
name: Release Binary
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
release:
types: [prereleased, released]
workflow_dispatch:
inputs:
ref_name:
description: Release Version
required: true
release:
required: true
type: boolean
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.24
- run: |
echo "VERSION=${{ (github.ref_name == 'main' && github.event_name == 'workflow_dispatch') && github.event.inputs.ref_name || github.ref_name }}" >> $GITHUB_ENV
- name: Compile HEPAgent ${{ matrix.goarch }}
run: |
go mod tidy
go generate
go build --ldflags '-linkmode=external -extldflags=-static' -o gigapi_querier ./
- name: glibc polyfill
run: |
CONTAINER_ID=$(docker create ghcr.io/lmangani/polyfill-glibc-action:latest)
docker cp $CONTAINER_ID:/usr/local/bin/polyfill-glibc ./polyfill-glibc
docker rm $CONTAINER_ID
chmod +x ./polyfill-glibc
./polyfill-glibc --target-glibc=2.17 ./gigapi_querier
- name: Upload release
if: github.event_name == 'release' || ${{ inputs.release }}
uses: boxpositron/upload-multiple-releases@1.0.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_config: |
gigapi_querier
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false
overwrite: true
docker:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.8.0
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
latest
${{ (github.event_name == 'workflow_dispatch') && github.event.inputs.ref_name || github.ref_name }}
- name: Build and push
uses: docker/build-push-action@v6.13.0
with:
context: .
file: Dockerfile
push: ${{ (github.event_name == 'workflow_dispatch') && github.event.inputs.release || github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64