Skip to content

Commit

Permalink
Onboard to RelAPI (#842)
Browse files Browse the repository at this point in the history
* Onboard to RelAPI

* actions should use v1 instead of branch name

* updating with fixes

* whoops, delete extra flags

* updating based on comments

Co-authored-by: Claire Labry <claire@hashicorp.com>
Co-authored-by: Sarah <sthompson@hashicorp.com>
  • Loading branch information
3 people authored May 10, 2022
1 parent 3377116 commit a82ef73
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 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@v2
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: ${{ secrets.HC_RELEASES_HOST_STAGING }}
HC_RELEASES_KEY: ${{ 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@v1
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@v1
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 }}
10 changes: 4 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ publishers:
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 }}
- HC_RELEASES_HOST={{ .Env.HC_RELEASES_HOST }}
- HC_RELEASES_KEY={{ .Env.HC_RELEASES_KEY }}
cmd: |
hc-releases upload -product {{ .ProjectName }} -version {{ .Version }} -file={{ .ArtifactPath }}
milestones:
- name_template: "{{ .Tag }}"
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.com/hashicorp/terraform-ls"
url_license = "https://github.com/hashicorp/terraform-ls/blob/main/LICENSE"

0 comments on commit a82ef73

Please sign in to comment.