-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (79 loc) · 2.69 KB
/
release.yml
File metadata and controls
91 lines (79 loc) · 2.69 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
name: Release opensuse 15.5 amd64 and arm64
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
actions: write
attestations: write
packages: read
jobs:
build:
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
container_opts: "--platform linux/amd64"
- arch: arm64
runner: ubuntu-24.04-arm
container_opts: "--platform linux/arm64"
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/sarus-suite/parallax/ci-runner:latest
options: ${{ matrix.container_opts }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
GITHUB_EVENT_PATH: ${{ github.event_path }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Dump GO env
run: |
echo "--- all GO* vars ---"
env | grep '^GO' || true
echo "--- go env ---"
go env
- name: Install go deps
run: go get .
- name: Build Linux binary ${{ matrix.arch }}
env:
CGO_ENABLED: "1"
CC: gcc
GOARCH: ${{ matrix.arch }}
GOOS: linux
GOFLAGS: "-buildvcs=false"
GO_LDFLAGS: "-linkmode external"
CGO_LDFLAGS: "-g -O2"
run: |
mkdir -p dist
BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
go build -v -x \
-ldflags "$GO_LDFLAGS \
-X=parallax/common.Version=${{ github.ref_name }} \
-X=parallax/common.Commit=${{ github.sha }} \
-X=parallax/common.BuildDate=${BUILD_DATE}" \
-o dist/parallax-${{ github.ref_name }}-opensuse-15.5-${{ matrix.arch }} \
.
- name: Inspect binary
run: |
file dist/parallax-${{ github.ref_name }}-opensuse-15.5-${{ matrix.arch }}
readelf -l dist/parallax-${{ github.ref_name }}-opensuse-15.5-${{ matrix.arch }} | grep interpreter || true
ldd dist/parallax-${{ github.ref_name }}-opensuse-15.5-${{ matrix.arch }} || echo "static :/"
- name: Create or Update GitHub Release and Upload Asset
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
artifacts: dist/parallax-${{ github.ref_name }}-opensuse-15.5-${{ matrix.arch }}
allowUpdates: true
replacesArtifacts: false
draft: false
prerelease: false