mirror of https://github.com/databricks/cli.git
78 lines
1.8 KiB
YAML
78 lines
1.8 KiB
YAML
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.21.x
|
|
|
|
- name: Hide snapshot tag to outsmart GoReleaser
|
|
run: git tag -d snapshot || true
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v4
|
|
with:
|
|
version: latest
|
|
args: release --snapshot --skip docker
|
|
|
|
- name: Upload macOS binaries
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: cli_darwin_snapshot
|
|
path: |
|
|
dist/*_darwin_*/
|
|
|
|
- name: Upload Linux binaries
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: cli_linux_snapshot
|
|
path: |
|
|
dist/*_linux_*/
|
|
|
|
- name: Upload Windows binaries
|
|
uses: actions/upload-artifact@v3
|
|
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
|