2022-12-22 09:25:24 +00:00
|
|
|
name: release-snapshot
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-03-29 19:43:21 +00:00
|
|
|
- "main"
|
|
|
|
- "demo-*"
|
2024-12-02 14:04:08 +00:00
|
|
|
- "bugbash-*"
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2024-10-31 12:09:23 +00:00
|
|
|
# Confirm that snapshot builds work if this file is modified.
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- opened
|
|
|
|
- synchronize
|
|
|
|
- reopened
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/release-snapshot.yml"
|
|
|
|
|
2022-12-22 09:25:24 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
goreleaser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository and submodules
|
2023-09-05 08:27:18 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-11-29 15:24:01 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
2022-12-22 09:25:24 +00:00
|
|
|
|
|
|
|
- name: Setup Go
|
2024-01-25 10:44:37 +00:00
|
|
|
uses: actions/setup-go@v5
|
2022-12-22 09:25:24 +00:00
|
|
|
with:
|
2024-10-31 12:42:14 +00:00
|
|
|
go-version: 1.23.2
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2024-07-04 11:39:55 +00:00
|
|
|
# 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
|
|
|
|
|
2023-04-12 20:16:30 +00:00
|
|
|
- name: Hide snapshot tag to outsmart GoReleaser
|
|
|
|
run: git tag -d snapshot || true
|
|
|
|
|
2022-12-22 09:25:24 +00:00
|
|
|
- name: Run GoReleaser
|
2024-07-04 11:39:55 +00:00
|
|
|
id: releaser
|
|
|
|
uses: goreleaser/goreleaser-action@v6
|
2022-12-22 09:25:24 +00:00
|
|
|
with:
|
2024-07-04 11:39:55 +00:00
|
|
|
version: ~> v2
|
2024-04-16 10:10:47 +00:00
|
|
|
args: release --snapshot --skip docker
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-12-22 10:01:50 +00:00
|
|
|
- name: Upload macOS binaries
|
2024-07-04 06:54:30 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-12-22 09:25:24 +00:00
|
|
|
with:
|
2023-05-16 16:35:39 +00:00
|
|
|
name: cli_darwin_snapshot
|
2022-12-22 10:01:50 +00:00
|
|
|
path: |
|
2023-05-16 16:35:39 +00:00
|
|
|
dist/*_darwin_*/
|
2022-12-22 10:01:50 +00:00
|
|
|
|
|
|
|
- name: Upload Linux binaries
|
2024-07-04 06:54:30 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-12-22 10:01:50 +00:00
|
|
|
with:
|
2023-05-16 16:35:39 +00:00
|
|
|
name: cli_linux_snapshot
|
2022-12-22 10:01:50 +00:00
|
|
|
path: |
|
2023-05-16 16:35:39 +00:00
|
|
|
dist/*_linux_*/
|
2022-12-22 10:01:50 +00:00
|
|
|
|
|
|
|
- name: Upload Windows binaries
|
2024-07-04 06:54:30 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-12-22 10:01:50 +00:00
|
|
|
with:
|
2023-05-16 16:35:39 +00:00
|
|
|
name: cli_windows_snapshot
|
2022-12-22 10:01:50 +00:00
|
|
|
path: |
|
2023-05-16 16:35:39 +00:00
|
|
|
dist/*_windows_*/
|
2023-04-12 20:16:30 +00:00
|
|
|
|
|
|
|
- name: Update snapshot tag
|
|
|
|
|
|
|
|
# Snapshot release may only be updated for commits to the main branch.
|
2023-11-29 15:24:01 +00:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2023-04-12 20:16:30 +00:00
|
|
|
|
|
|
|
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.
|
2023-11-29 15:24:01 +00:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2023-04-12 20:16:30 +00:00
|
|
|
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
name: Snapshot
|
|
|
|
prerelease: true
|
|
|
|
tag_name: snapshot
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
files: |
|
2023-05-16 16:35:39 +00:00
|
|
|
dist/databricks_cli_*.zip
|