2022-05-13 15:43:54 +00:00
|
|
|
name: release
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-09-08 12:13:43 +00:00
|
|
|
workflow_dispatch:
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
jobs:
|
|
|
|
goreleaser:
|
2023-10-11 13:50:55 +00:00
|
|
|
outputs:
|
|
|
|
artifacts: ${{ steps.releaser.outputs.artifacts }}
|
2022-05-13 15:43:54 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-09-08 13:12:26 +00:00
|
|
|
- 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-12 15:51:27 +00:00
|
|
|
|
2022-09-08 09:21:00 +00:00
|
|
|
- name: Setup Go
|
2024-01-25 10:44:37 +00:00
|
|
|
uses: actions/setup-go@v5
|
2022-05-13 15:43:54 +00:00
|
|
|
with:
|
2024-09-25 15:45:28 +00:00
|
|
|
go-version: 1.22.7
|
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
|
|
|
|
|
2024-04-12 15:22:30 +00:00
|
|
|
# Log into the GitHub Container Registry. The goreleaser action will create
|
|
|
|
# the docker images and push them to the GitHub Container Registry.
|
|
|
|
- uses: "docker/login-action@v3"
|
|
|
|
with:
|
|
|
|
registry: "ghcr.io"
|
|
|
|
username: "${{ github.actor }}"
|
|
|
|
password: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
|
|
|
|
# QEMU is required to build cross platform docker images using buildx.
|
|
|
|
# It allows virtualization of the CPU architecture at the application level.
|
|
|
|
- name: Set up QEMU dependency
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
- name: Run GoReleaser
|
2023-10-11 13:50:55 +00:00
|
|
|
id: releaser
|
2024-06-05 11:33:51 +00:00
|
|
|
uses: goreleaser/goreleaser-action@v6
|
2022-05-13 15:43:54 +00:00
|
|
|
with:
|
2024-06-05 11:33:51 +00:00
|
|
|
version: ~> v2
|
2023-04-20 09:59:34 +00:00
|
|
|
args: release
|
2022-05-13 15:43:54 +00:00
|
|
|
env:
|
2022-09-08 12:13:43 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-10-04 14:03:37 +00:00
|
|
|
|
2023-10-10 10:58:02 +00:00
|
|
|
create-setup-cli-release-pr:
|
2023-10-04 14:03:37 +00:00
|
|
|
needs: goreleaser
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set VERSION variable from tag
|
|
|
|
run: |
|
|
|
|
VERSION=${{ github.ref_name }}
|
|
|
|
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Update setup-cli
|
2024-10-31 12:31:17 +00:00
|
|
|
uses: actions/github-script@v7
|
2023-10-04 14:03:37 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
|
|
|
|
script: |
|
|
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
|
|
owner: 'databricks',
|
|
|
|
repo: 'setup-cli',
|
|
|
|
workflow_id: 'release-pr.yml',
|
|
|
|
ref: 'main',
|
|
|
|
inputs: {
|
|
|
|
version: "${{ env.VERSION }}",
|
|
|
|
}
|
|
|
|
});
|
2023-10-10 10:58:02 +00:00
|
|
|
|
|
|
|
create-homebrew-tap-release-pr:
|
|
|
|
needs: goreleaser
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set VERSION variable from tag
|
|
|
|
run: |
|
|
|
|
VERSION=${{ github.ref_name }}
|
|
|
|
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Update homebrew-tap
|
2024-10-31 12:31:17 +00:00
|
|
|
uses: actions/github-script@v7
|
2023-10-10 10:58:02 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
|
|
|
|
script: |
|
2024-04-23 13:31:36 +00:00
|
|
|
let artifacts = ${{ needs.goreleaser.outputs.artifacts }}
|
2023-10-10 10:58:02 +00:00
|
|
|
artifacts = artifacts.filter(a => a.type == "Archive")
|
|
|
|
artifacts = new Map(
|
|
|
|
artifacts.map(a => [
|
|
|
|
a.goos + "_" + a.goarch,
|
|
|
|
a.extra.Checksum.replace("sha256:", "")
|
|
|
|
])
|
|
|
|
)
|
|
|
|
|
|
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
|
|
owner: 'databricks',
|
|
|
|
repo: 'homebrew-tap',
|
|
|
|
workflow_id: 'release-pr.yml',
|
|
|
|
ref: 'main',
|
|
|
|
inputs: {
|
|
|
|
version: "${{ env.VERSION }}",
|
|
|
|
darwin_amd64_sha: artifacts.get('darwin_amd64'),
|
|
|
|
darwin_arm64_sha: artifacts.get('darwin_arm64'),
|
|
|
|
linux_amd64_sha: artifacts.get('linux_amd64'),
|
|
|
|
linux_arm64_sha: artifacts.get('linux_arm64')
|
|
|
|
}
|
|
|
|
});
|
2023-11-28 10:50:16 +00:00
|
|
|
|
|
|
|
create-vscode-extension-update-pr:
|
|
|
|
needs: goreleaser
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set VERSION variable from tag
|
|
|
|
run: |
|
|
|
|
VERSION=${{ github.ref_name }}
|
|
|
|
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Update CLI version in the VSCode extension
|
2024-10-31 12:31:17 +00:00
|
|
|
uses: actions/github-script@v7
|
2023-11-28 10:50:16 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
|
|
|
|
script: |
|
|
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
|
|
owner: 'databricks',
|
|
|
|
repo: 'databricks-vscode',
|
|
|
|
workflow_id: 'update-cli-version.yml',
|
|
|
|
ref: 'main',
|
|
|
|
inputs: {
|
|
|
|
version: "${{ env.VERSION }}",
|
|
|
|
}
|
|
|
|
});
|