-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (93 loc) · 2.77 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (93 loc) · 2.77 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
name: Release
on:
push:
tags:
- 'v*.*.*' # Matches semantic version tags
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: windows
arch: amd64
- os: windows
arch: arm64
- os: darwin
arch: amd64
- os: darwin
arch: arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Build frontend
working-directory: frontend
run: npm ci && npm run build
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.4'
check-latest: true
- name: Install dependencies
run: go mod download
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build binary
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
run: |
go build -ldflags "-X 'github.com/hydrocode-de/datailama/internal/version.BuildTime=$(date -u '+%Y-%m-%d %H:%M:%S UTC')' -X 'github.com/hydrocode-de/datailama/internal/version.GitCommit=$(git rev-parse --short HEAD)'" -o datailama-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }} .
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: datailama-${{ matrix.os }}-${{ matrix.arch }}
path: datailama-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: datailama-*
- name: List artifacts
run: find artifacts -type f
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/datailama-darwin-amd64/*
artifacts/datailama-darwin-arm64/*
artifacts/datailama-linux-amd64/*
artifacts/datailama-linux-arm64/*
artifacts/datailama-windows-amd64/*
artifacts/datailama-windows-arm64/*
body_path: RELEASE.md
draft: false
prerelease: false
generate_release_notes: false
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}