-
-
Notifications
You must be signed in to change notification settings - Fork 147
85 lines (73 loc) · 2.6 KB
/
release.yml
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
name: Create release
on:
push:
tags:
- 'v*'
jobs:
build_releases:
name: Build binary - ${{ matrix.binary_os_suffix }}-${{ matrix.binary_arch_suffix }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref_name }}
MESSAGE: "WIP"
FILENAME: hetzner-k3s-${{ matrix.binary_os_suffix }}-${{ matrix.binary_arch_suffix }}
strategy:
matrix:
include:
- runs_on_tag: macos-latest
binary_os_suffix: macos
binary_arch_suffix: amd64
- runs_on_tag: macos-14
binary_os_suffix: macos
binary_arch_suffix: arm64
architecture: arm
- runs_on_tag: ubuntu-22.04
binary_os_suffix: linux
binary_arch_suffix: arm64
arch: aarch64
distro: alpine_latest
- runs_on_tag: ubuntu-24.04
binary_os_suffix: linux
binary_arch_suffix: amd64
arch: none
distro: none
base_image: amd64/alpine
runs-on: ${{ matrix.runs_on_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
set-safe-directory: '/home/runner/work/hetzner-k3s/hetzner-k3s'
- if: matrix.binary_os_suffix == 'macos'
name: macos build step
run: |
brew install crystal libssh2 openssl@3
shards install --without-development
crystal build src/hetzner-k3s.cr --release
chmod +x hetzner-k3s
cp hetzner-k3s ${{ env.FILENAME }}
- if: matrix.binary_os_suffix == 'linux'
uses: uraimo/run-on-arch-action@v2
name: linux build step
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
base_image: ${{ matrix.base_image }}
shell: /bin/sh
install: |
apk update
apk add --update --no-cache gcc gmp-dev libevent-static musl-dev pcre-dev pcre2-dev libxml2-dev \
libxml2-static openssl-dev openssl-libs-static tzdata yaml-static zlib-static xz-static \
make git autoconf automake libtool patch libssh2-static libssh2-dev crystal shards
run: |
shards install --without-development
crystal build src/hetzner-k3s.cr --release --static
cp hetzner-k3s ${{ env.FILENAME }}
- name: Publish new version
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ env.GITHUB_TOKEN }}
file: ${{ env.FILENAME }}
tag: ${{ env.VERSION }}
overwrite: true
body: ${{ env.MESSAGE }}