mirror of https://github.com/databricks/cli.git
Automatically create a release PR in homebrew-tap repo (#841)
## Changes Automatically create a release PR in homebrew-tap repo ## Tests Ran ` act -j create-homebrew-tap-release-pr -s DECO_GITHUB_TOKEN="$(gh auth token)"` Result: https://github.com/databricks/homebrew-tap/pull/29
This commit is contained in:
parent
8c1441ff71
commit
803ecb5efd
|
@ -30,7 +30,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
create-release-prs:
|
create-setup-cli-release-pr:
|
||||||
needs: goreleaser
|
needs: goreleaser
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -53,3 +53,40 @@ jobs:
|
||||||
version: "${{ env.VERSION }}",
|
version: "${{ env.VERSION }}",
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue