Repository navigation
130 lines (109 loc) · 3.39 KB
/
Copy pathrelease.yml
File metadata and controls
130 lines (109 loc) · 3.39 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
suffix: linux-amd64
- goos: linux
goarch: arm64
suffix: linux-arm64
- goos: linux
goarch: arm
goarm: "7"
suffix: linux-armv7
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
check-latest: true
- name: Set build metadata
id: meta
run: |
echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
echo "commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
echo "date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: "0"
run: |
mkdir -p dist
ls -lh dist
ls -lh
go build \
-ldflags="-s -w \
-X main.Version=${{ steps.meta.outputs.version }} \
-X main.Commit=${{ steps.meta.outputs.commit }} \
-X main.BuildDate=${{ steps.meta.outputs.date }}" \
-o dist/bytes-dns-${{ matrix.suffix }} \
github.com/bytes-commerce/bytes-dns/cmd/bytes-dns
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bytes-dns-${{ matrix.suffix }}
path: dist/bytes-dns-${{ matrix.suffix }}
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Generate checksums
working-directory: dist
run: |
sha256sum bytes-dns-* > checksums.txt
cat checksums.txt
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: "bytes-dns ${{ github.ref_name }}"
body: |
## bytes-dns ${{ github.ref_name }}
DynDNS via Hetzner, for free.
### Installation
```bash
# Download for your architecture (example: amd64):
curl -Lo /usr/local/bin/bytes-dns \
https://github.com/bytes-commerce/bytes-dns/releases/download/${{ github.ref_name }}/bytes-dns-linux-amd64
chmod +x /usr/local/bin/bytes-dns
# Or clone and install with systemd:
git clone https://github.com/bytes-commerce/bytes-dns
cd bytes-dns
sudo bash install.sh
```
### Verify checksums
```bash
sha256sum -c checksums.txt
```
See [README.md](https://github.com/bytes-commerce/bytes-dns#readme) for full documentation.
files: |
dist/bytes-dns-linux-amd64
dist/bytes-dns-linux-arm64
dist/bytes-dns-linux-armv7
dist/checksums.txt
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}