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
|
2022-12-12 15:51:27 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
- name: Unshallow
|
|
|
|
run: git fetch --prune --unshallow
|
2022-12-12 15:51:27 +00:00
|
|
|
|
2022-09-08 09:21:00 +00:00
|
|
|
- name: Setup Go
|
2023-08-30 14:57:34 +00:00
|
|
|
uses: actions/setup-go@v4
|
2022-05-13 15:43:54 +00:00
|
|
|
with:
|
2023-08-15 13:50:40 +00:00
|
|
|
go-version: 1.21.0
|
2022-12-22 09:25:24 +00:00
|
|
|
|
2022-05-13 15:43:54 +00:00
|
|
|
- name: Run GoReleaser
|
2023-10-11 13:50:55 +00:00
|
|
|
id: releaser
|
2022-12-22 10:01:50 +00:00
|
|
|
uses: goreleaser/goreleaser-action@v4
|
2022-05-13 15:43:54 +00:00
|
|
|
with:
|
|
|
|
version: latest
|
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
|
|
|
|
uses: actions/github-script@v6
|
|
|
|
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
|
|
|
|
uses: actions/github-script@v6
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.DECO_GITHUB_TOKEN }}
|
|
|
|
script: |
|
|
|
|
let artifacts = JSON.parse('${{ needs.goreleaser.outputs.artifacts }}')
|
|
|
|
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')
|
|
|
|
}
|
|
|
|
});
|