Skip to content

Commit a86af34

Browse files
authored
chore: add upload of release artifacts to GitHub releases (#319)
1 parent bebcf08 commit a86af34

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/main.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,37 @@
648648
"run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..."
649649
}
650650
]
651+
},
652+
"publish": {
653+
"name": "publish",
654+
"needs": [
655+
"build_and_test"
656+
],
657+
"runs-on": "ubuntu-latest",
658+
"steps": [
659+
{
660+
"name": "Download release artifacts",
661+
"uses": "actions/download-artifact@v4",
662+
"with": {
663+
"merge-multiple": true
664+
}
665+
},
666+
{
667+
"name": "Calculate shasum",
668+
"run": "shasum -a 256 assets/* > sha256"
669+
},
670+
{
671+
"name": "Create GitHub release and upload artifacts",
672+
"uses": "softprops/action-gh-release@v2",
673+
"with": {
674+
"files": [
675+
"assets/*",
676+
"sha256"
677+
],
678+
"make_latest": true
679+
}
680+
}
681+
]
651682
}
652683
},
653684
"name": "main",

tools/github_workflows/workflows_template.libsonnet

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,32 @@
148148
else []
149149
),
150150
},
151+
[if doUpload then 'publish']: {
152+
'runs-on': 'ubuntu-latest',
153+
name: 'publish',
154+
needs: ['build_and_test'],
155+
steps: [
156+
{
157+
name: 'Download release artifacts',
158+
uses: 'actions/download-artifact@v4',
159+
with: {
160+
'merge-multiple': true,
161+
},
162+
},
163+
{
164+
name: 'Calculate shasum',
165+
run: 'shasum -a 256 assets/* > sha256',
166+
},
167+
{
168+
name: 'Create GitHub release and upload artifacts',
169+
uses: 'softprops/action-gh-release@v2',
170+
with: {
171+
make_latest: true,
172+
files: ['assets/*', 'sha256'],
173+
},
174+
},
175+
],
176+
},
151177
lint: {
152178
'runs-on': 'ubuntu-latest',
153179
name: 'lint',

0 commit comments

Comments
 (0)