Skip to content

Commit

Permalink
Onboard project to RelAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanneryan committed Mar 28, 2022
1 parent 031e30f commit 33a84b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,19 @@ jobs:
name: Install signore
uses: hashicorp/setup-signore-package@v1
-
uses: hashicorp/setup-hc-releases@v1
name: Setup hc-releases
uses: hashicorp/actions-setup-hc-releases@v1
with:
github-token: ${{ secrets.CODESIGN_GITHUB_TOKEN }}
-
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TERRAFORM_PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TERRAFORM_PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.TERRAFORM_PROD_AWS_ROLE_TO_ASSUME }}
role-skip-session-tagging: true
role-duration-seconds: 3600
-
name: Release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release
env:
HC_RELEASES_HOST_STAGING: ${{ secrets.HC_RELEASES_HOST_STAGING }}
HC_RELEASES_KEY_STAGING: ${{ secrets.HC_RELEASES_KEY_STAGING }}
CODESIGN_IMAGE: ${{ steps.codesign.outputs.image }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
Expand All @@ -82,7 +75,20 @@ jobs:
SIGNORE_CLIENT_SECRET: ${{ secrets.SIGNORE_CLIENT_SECRET }}
SIGNORE_SIGNER: ${{ secrets.SIGNORE_SIGNER }}
-
name: Publish released artifacts
run: hc-releases publish -product=terraform-ls
env:
FASTLY_API_TOKEN: ${{ secrets.RELEASE_FASTLY_API_TOKEN }}
name: Create Release metadata
uses: hashicorp/actions-hc-releases-create-metadata@main
with:
private-tools-token: ${{ secrets.CODESIGN_GITHUB_TOKEN }}
product-name: "terraform-ls"
version: ${{ github.ref_name }}
hc-releases-host: ${{ secrets.HC_RELEASES_HOST_STAGING}}
hc-releases-key: ${{ secrets.HC_RELEASES_KEY_STAGING }}
-
name: Promote
uses: hashicorp/actions-hc-releases-promote@main
with:
product-name: "terraform-ls"
version: ${{ github.ref_name }}
hc-releases-host: ${{ secrets.HC_RELEASES_HOST_PROD }}
hc-releases-key: ${{ secrets.HC_RELEASES_KEY_PROD }}
hc-releases-source_env_key: ${{ secrets.HC_RELEASES_KEY_STAGING }}
14 changes: 6 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,18 @@ brews:
system "#{bin}/terraform-ls --version"
publishers:
- name: "hc-releases"
- name: upload
checksum: true
signature: true
env:
- AWS_DEFAULT_REGION={{ .Env.AWS_DEFAULT_REGION }}
- AWS_REGION={{ .Env.AWS_REGION }}
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
- AWS_SESSION_TOKEN={{ .Env.AWS_SESSION_TOKEN }}
cmd: hc-releases upload-file {{ abs .ArtifactPath }}

milestones:
- name_template: "{{ .Tag }}"
close: true
- HC_RELEASES_HOST={{ .Env.HC_RELEASES_HOST_STAGING }}
- HC_RELEASES_KEY={{ .Env.HC_RELEASES_KEY_STAGING }}
dir: "{{ dir .ArtifactPath }}"
cmd: |
hc-releases upload -file={{ .ArtifactName }} -product={{ .ProjectName }} -version={{ .Version }}
release:
prerelease: auto
Expand Down
2 changes: 2 additions & 0 deletions .release/release-metadata.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
url_source_repository = "https://github/hashicorp/terraform-ls"
url_license = "https://github.com/hashicorp/terraform-ls/blob/main/LICENSE"

0 comments on commit 33a84b1

Please sign in to comment.