-
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (134 loc) · 4.34 KB
/
Copy pathrelease.yml
File metadata and controls
151 lines (134 loc) · 4.34 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Release Compilation and Deployment
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build-release:
name: Build & Package VALKYRIE Release Assets
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout VALKYRIE Repository
uses: actions/checkout@v4
with:
path: VALKYRIE
# Since go.mod uses a relative path replace directive to ORCHID,
# we check out the ORCHID repository as a sibling directory.
# If ORCHID is private, make sure to set the ORCHID_REPO_TOKEN secret in your repo.
- name: Checkout ORCHID Dependency
uses: actions/checkout@v4
with:
repository: DigitalServerHost/ORCHID
ref: main
token: ${{ secrets.ORCHID_REPO_TOKEN || secrets.GITHUB_TOKEN }}
path: ORCHID
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: true
- name: Build VALKYRIE Proving Proxy
run: |
BINARY_NAME=valkyrie
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=valkyrie.exe
fi
cd VALKYRIE
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -v -o ../bin/$BINARY_NAME cmd/valkyrie-proxy/main.go
env:
CGO_ENABLED: 0
- name: Compress Release Artifacts
run: |
mkdir -p dist
# Archive artifacts based on operating system
if [ "${{ matrix.goos }}" = "windows" ]; then
cd bin
zip ../dist/valkyrie-${{ matrix.goos }}-${{ matrix.goarch }}.zip valkyrie.exe
cd ..
else
tar -czf dist/valkyrie-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C bin valkyrie
fi
- name: Upload Packaged Artifacts
uses: actions/upload-artifact@v4
with:
name: assets-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
retention-days: 1
create-release:
name: Create GitHub Release
needs: build-release
runs-on: ubuntu-latest
steps:
- name: Download Built Artifacts
uses: actions/download-artifact@v4
with:
path: all-assets
merge-multiple: true
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
name: Project VALKYRIE ${{ github.ref_name }}
files: all-assets/*
draft: false
prerelease: false
generate_release_notes: true
# Read tag info from the tag checkout
tag_name: ${{ github.ref_name }}
token: ${{ secrets.MCP_PAT }}
publish-docker:
name: Build & Push Docker Image to GHCR
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout VALKYRIE Repository
uses: actions/checkout@v4
with:
path: VALKYRIE
# Sibling checkout of ORCHID for relative imports in builder stage
- name: Checkout ORCHID Dependency
uses: actions/checkout@v4
with:
repository: DigitalServerHost/ORCHID
ref: main
token: ${{ secrets.ORCHID_REPO_TOKEN || secrets.GITHUB_TOKEN }}
path: ORCHID
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: mcpwest
password: ${{ secrets.MCP_PAT }}
- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/digitalserverhost/valkyrie
tags: |
type=ref,event=branch
type=ref,event=tag
type=match,pattern=v(.*),group=1
type=sha,format=short
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: VALKYRIE/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max