2022-12-22 09:25:24 +00:00
|
|
|
name: release-snapshot
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-03-29 19:43:21 +00:00
|
|
|
- "main"
|
|
|
|
- "demo-*"
|
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
|
2023-08-30 14:57:34 +00:00
|
|
|
uses: actions/setup-go@v4
|
2022-12-22 09:25:24 +00:00
|
|
|
with:
|
2023-08-15 13:50:40 +00:00
|
|
|
go-version: 1.21.0
|
2022-12-22 09:25:24 +00:00
|
|
|
|
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
|
|
|
|
uses: goreleaser/goreleaser-action@v4
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --snapshot
|
|
|
|
|
2022-12-22 10:01:50 +00:00
|
|
|
- name: Upload macOS binaries
|
2022-12-22 09:25:24 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
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
|