-
Notifications
You must be signed in to change notification settings - Fork 8
140 lines (119 loc) · 4.23 KB
/
Copy pathrelease.yaml
File metadata and controls
140 lines (119 loc) · 4.23 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
name: Release
on:
release:
types: [published]
env:
DAGGER_VERSION: "0.20.6"
jobs:
build-linux:
name: Build & Upload Linux
runs-on: depot-ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dagger
uses: dagger/dagger-for-github@v8.2.0
with:
version: ${{ env.DAGGER_VERSION }}
- name: Build and upload Linux release artifacts to bucket
run: |
dagger call \
release-latest \
--version="${{ github.event.release.tag_name }}" \
--commit="${{ github.sha }}" \
--post-hog-public-key="${{ secrets.POSTHOG_API_KEY }}" \
--endpoint=env://BUCKET_ENDPOINT \
--bucket=env://BUCKET_NAME \
--access-key-id=env://BUCKET_ACCESS_KEY_ID \
--secret-access-key=env://BUCKET_SECRET_ACCESS_KEY \
export \
--path=./build
env:
BUCKET_ENDPOINT: ${{ secrets.BUCKET_ENDPOINT }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
BUCKET_ACCESS_KEY_ID: ${{ secrets.BUCKET_ACCESS_KEY_ID }}
BUCKET_SECRET_ACCESS_KEY: ${{ secrets.BUCKET_SECRET_ACCESS_KEY }}
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
- name: Upload linux artifacts for gh release
uses: actions/upload-artifact@v4
with:
name: linux-release
path: build/
retention-days: 1
build-darwin:
name: Build macOS arm64
runs-on: macos-15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build and codesign darwin/arm64 binary
run: make apple-build POSTHOG_API_KEY="${{ secrets.POSTHOG_API_KEY }}"
- name: Generate checksum
run: shasum -a 256 build/darwin/arm64/mb > build/darwin/arm64/mb.sha256
- name: Upload darwin artifacts for gh release
uses: actions/upload-artifact@v4
with:
name: darwin-release
path: build/
retention-days: 1
upload:
name: Upload Release Artifacts
needs: [build-linux, build-darwin]
runs-on: depot-ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download linux artifacts
uses: actions/download-artifact@v4
with:
name: linux-release
path: build/
- name: Download darwin artifacts
uses: actions/download-artifact@v4
with:
name: darwin-release
path: build/
- name: Install Dagger
uses: dagger/dagger-for-github@v8.2.0
with:
version: ${{ env.DAGGER_VERSION }}
- name: Upload darwin artifacts to bucket
run: |
VERSION="${{ github.event.release.tag_name }}"
dagger call \
upload-darwin-artifacts \
--binary=./build/darwin/arm64/mb \
--checksum=./build/darwin/arm64/mb.sha256 \
--prefixes="${VERSION}/darwin/arm64","latest/darwin/arm64" \
--endpoint=env://BUCKET_ENDPOINT \
--bucket=env://BUCKET_NAME \
--access-key-id=env://BUCKET_ACCESS_KEY_ID \
--secret-access-key=env://BUCKET_SECRET_ACCESS_KEY
env:
BUCKET_ENDPOINT: ${{ secrets.BUCKET_ENDPOINT }}
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
BUCKET_ACCESS_KEY_ID: ${{ secrets.BUCKET_ACCESS_KEY_ID }}
BUCKET_SECRET_ACCESS_KEY: ${{ secrets.BUCKET_SECRET_ACCESS_KEY }}
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}
- name: Upload all artifacts to GitHub release
run: |
dagger call -m github.com/papercomputeco/daggerverse/ghrelease \
--token=env://GH_TOKEN \
with-repo --repo="${{ github.repository }}" \
with-assets --assets=./build \
with-flatten \
with-tag --tag="${{ github.event.release.tag_name }}" \
upload
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}