forked from hashicorp/terraform-ls
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Automate releasing via bob (hashicorp#1167)
* ci: Automate releasing via bob * CONTRIBUTING: remove outdated release step
- Loading branch information
1 parent
092ab28
commit f76188d
Showing
2 changed files
with
77 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version' | ||
required: true | ||
type: string | ||
sha: | ||
description: 'SHA' | ||
required: true | ||
type: string | ||
branch: | ||
description: 'Branch' | ||
type: string | ||
default: main | ||
|
||
jobs: | ||
staging: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup bob | ||
uses: hashicorp/action-setup-bob@v1 | ||
with: | ||
github-token: | ||
${{ secrets.BOB_GITHUB_TOKEN }} | ||
- name: Promote to staging | ||
env: | ||
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }} | ||
VERSION: ${{ github.event.inputs.version }} | ||
SHA: ${{ github.event.inputs.sha }} | ||
BRANCH: main | ||
ENVIRONMENT: staging | ||
run: | | ||
bob trigger-promotion \ | ||
--product-name=terraform-ls \ | ||
--environment=terraform-ls-oss \ | ||
--org=hashicorp \ | ||
--repo=terraform-ls \ | ||
--slack-channel=C02AGQXCAF5 \ | ||
--product-version=$VERSION \ | ||
--sha=$SHA \ | ||
--branch=$BRANCH \ | ||
$ENVIRONMENT | ||
production: | ||
runs-on: ubuntu-latest | ||
needs: staging | ||
steps: | ||
- name: Setup bob | ||
uses: hashicorp/action-setup-bob@v1 | ||
with: | ||
github-token: | ||
${{ secrets.BOB_GITHUB_TOKEN }} | ||
- name: Promote to production | ||
env: | ||
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }} | ||
VERSION: ${{ github.event.inputs.version }} | ||
SHA: ${{ github.event.inputs.sha }} | ||
BRANCH: main | ||
ENVIRONMENT: production | ||
run: | | ||
bob trigger-promotion \ | ||
--product-name=terraform-ls \ | ||
--environment=terraform-ls-oss \ | ||
--org=hashicorp \ | ||
--repo=terraform-ls \ | ||
--slack-channel=C02AGQXCAF5 \ | ||
--product-version=$VERSION \ | ||
--sha=$SHA \ | ||
--branch=$BRANCH \ | ||
$ENVIRONMENT |