-
Notifications
You must be signed in to change notification settings - Fork 21
74 lines (65 loc) · 2.57 KB
/
Copy pathbuild.yml
File metadata and controls
74 lines (65 loc) · 2.57 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
name: build
on:
push:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
ext: ''
- goos: windows
goarch: amd64
ext: '.exe'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Get dependencies
run: go mod download
- name: Unzip embedded bindata
run: |
unzip -o lib/dat/bindata.go.zip -d lib/dat/
unzip -o lib/ext/cdhit/unix/bindata.go.zip -d lib/ext/cdhit/unix/
unzip -o lib/ext/cdhit/win/bindata.go.zip -d lib/ext/cdhit/win/
unzip -o lib/ext/comet/unix/bindata.go.zip -d lib/ext/comet/unix/
unzip -o lib/ext/comet/win/bindata.go.zip -d lib/ext/comet/win/
unzip -o lib/ext/interprophet/unix/bindata.go.zip -d lib/ext/interprophet/unix/
unzip -o lib/ext/interprophet/win/bindata.go.zip -d lib/ext/interprophet/win/
unzip -o lib/ext/peptideprophet/unix/bindata.go.zip -d lib/ext/peptideprophet/unix/
unzip -o lib/ext/peptideprophet/win/bindata.go.zip -d lib/ext/peptideprophet/win/
unzip -o lib/ext/proteinprophet/unix/bindata.go.zip -d lib/ext/proteinprophet/unix/
unzip -o lib/ext/proteinprophet/win/bindata.go.zip -d lib/ext/proteinprophet/win/
unzip -o lib/ext/ptmprophet/unix/bindata.go.zip -d lib/ext/ptmprophet/unix/
unzip -o lib/ext/ptmprophet/win/bindata.go.zip -d lib/ext/ptmprophet/win/
unzip -o lib/obo/unimod/bindata.go.zip -d lib/obo/unimod/
unzip -o lib/pip/bindata.go.zip -d lib/pip/
- name: Build
env:
CGO_ENABLED: '0'
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
BUILD=$(date +%Y%m%d%H%M)
VERSION="${GITHUB_REF_NAME}-${GITHUB_SHA::7}"
OUTPUT="philosopher-${GOOS}-${GOARCH}${{ matrix.ext }}"
go build -trimpath \
-ldflags "-w -s -X main.version=${VERSION} -X main.build=${BUILD}" \
-o "${OUTPUT}" main.go
ls -lh "${OUTPUT}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: philosopher-${{ matrix.goos }}-${{ matrix.goarch }}
path: philosopher-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}
if-no-files-found: error