-
Notifications
You must be signed in to change notification settings - Fork 57
85 lines (69 loc) · 2.17 KB
/
release-snapshot.yml
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
name: release-snapshot
on:
push:
branches:
- "main"
- "demo-*"
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
# The default cache key for this action considers only the `go.sum` file.
# We include .goreleaser.yaml here to differentiate from the cache used by the push action
# that runs unit tests. This job produces and uses a different cache.
cache-dependency-path: |
go.sum
.goreleaser.yaml
- name: Hide snapshot tag to outsmart GoReleaser
run: git tag -d snapshot || true
- name: Run GoReleaser
id: releaser
uses: goreleaser/goreleaser-action@v6
with:
version: ~> v2
args: release --snapshot --skip docker
- name: Upload macOS binaries
uses: actions/upload-artifact@v4
with:
name: cli_darwin_snapshot
path: |
dist/*_darwin_*/
- name: Upload Linux binaries
uses: actions/upload-artifact@v4
with:
name: cli_linux_snapshot
path: |
dist/*_linux_*/
- name: Upload Windows binaries
uses: actions/upload-artifact@v4
with:
name: cli_windows_snapshot
path: |
dist/*_windows_*/
- name: Update snapshot tag
# Snapshot release may only be updated for commits to the main branch.
if: github.ref == 'refs/heads/main'
run: |
git tag snapshot
git push origin snapshot --force
- name: Update snapshot release
# Snapshot release may only be updated for commits to the main branch.
if: github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v1
with:
name: Snapshot
prerelease: true
tag_name: snapshot
token: ${{ secrets.GITHUB_TOKEN }}
files: |
dist/databricks_cli_*.zip